diff --git a/CHANGES.md b/CHANGES.md
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,12 +1,16 @@
-**Clafer Version 0.3.8 released on Jan 27, 2015**
+**Clafer Version 0.3.9 released on March 06, 2015**
 
+[Release](https://github.com/gsdlab/clafer/pull/63)
+
+**Clafer Version 0.3.8 released on January 27, 2015**
+
 [Release](https://github.com/gsdlab/clafer/pull/60)
 
-**Clafer Version 0.3.7 released on Oct 23, 2014**
+**Clafer Version 0.3.7 released on October 23, 2014**
 
 [Release](https://github.com/gsdlab/clafer/pull/53)
 
-**Clafer Version 0.3.6.1 released on Jul 08, 2014**
+**Clafer Version 0.3.6.1 released on July 08, 2014**
 
 [Release](https://github.com/gsdlab/clafer/pull/50)
 
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 TOOL_DIR := tools
 
 ifeq ($(OS),Windows_NT)
-	GPLK_LIBS_INCLUDES := --extra-include-dirs=$(glpk)/src --extra-include-dirs=$(glpk)/src/amd --extra-include-dirs=$(glpk)/src/colamd --extra-include-dirs=$(glpk)/src/minisat --extra-include-dirs=$(glpk)/src/zlib --extra-lib-dirs=$(glpk)/w32
+
 else
 	UNAME_S := $(shell uname -s)
 	ifeq ($(UNAME_S),Darwin)
@@ -15,7 +15,11 @@
 
 init:
 	cabal sandbox init --sandbox=../.clafertools-cabal-sandbox
-	cabal install --only-dependencies $(GPLK_LIBS_INCLUDES) $(MAC_USR_LIB) --enable-tests
+	# Uncomment to use Haskell LTS in the sandbox
+	# wget http://www.stackage.org/snapshot/lts-1.4/cabal.config
+	# mv cabal.config ../.clafertools-cabal-sandbox
+	# the constraint is there to prevent installing utf8-string-1 which conflicts with gitit, which requires utf8-string <= 0.3.8.
+	cabal install --only-dependencies $(MAC_USR_LIB) --enable-tests --constraint="utf8-string==0.3.8"
 
 build:
 	$(MAKE) -C $(TOOL_DIR)
@@ -31,8 +35,7 @@
 	cp -f tools/alloy4.2.jar $(to)/tools
 	cp -f tools/XsdCheck.class $(to)/tools
 	cp -f tools/ecore2clafer.jar $(to)/tools
-	if test "$(glpk)" ; then cp -f $(glpk)/w32/glpk_4_55.dll $(to); fi
-	cabal install --bindir=$(to) $(GPLK_LIBS_INCLUDES) $(MAC_USR_LIB) --ghc-option="-O"
+	cabal install --bindir=$(to) $(GPLK_LIBS_INCLUDES) $(MAC_USR_LIB) --ghc-option="-O2"
 
 # Removes current build and makes a clean new one (Don't use if starting from scratch!)
 cleanEnv:
@@ -53,14 +56,15 @@
 Css.hs:
 	$(MAKE) -C $(SRC_DIR) Css.hs
 
-# enable profiler
-# first remove `cabal` and `ghc` folders (on win: `<User>\AppData\Roaming\cabal` and `<User>\AppData\Roaming\ghc`)
+# Just like "init" but with enabled profiler
 # this will reinstall everything with profiling support, build clafer, and copy it to .
 prof:
-	cabal update
-	cabal install --only-dependencies -p --enable-executable-profiling $(GPLK_LIBS_INCLUDES) $(MAC_USR_LIB)
-	cabal configure -p --enable-executable-profiling
-	cabal build --ghc-options="-prof -auto-all -rtsopts"
+	rm -rf ../.clafertools-cabal-sandbox
+	cabal sandbox init --sandbox=../.clafertools-cabal-sandbox
+	cabal install --only-dependencies $(MAC_USR_LIB) --enable-tests -p --enable-executable-profiling --enable-library-profiling
+	$(MAKE) -C $(TOOL_DIR)
+	cabal configure -p --enable-executable-profiling --enable-library-profiling
+	cabal build --ghc-options="-prof -fprof-auto -auto-all -caf-all -rtsopts -osuf p_o"
 
 .PHONY : test
 
@@ -86,3 +90,6 @@
 
 cleanTest:
 	$(MAKE) -C $(TEST_DIR) clean
+
+tags:
+	hasktags --ctags --extendedctag .
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 Clafer
 ======
 
-v0.3.8
+v0.3.9
 
 [Clafer](http://clafer.org) is a general-purpose lightweight structural modeling language developed by 
 [GSD Lab](http://gsd.uwaterloo.ca/), [University of Waterloo](http://uwaterloo.ca), and 
@@ -58,44 +58,18 @@
 
 Regardless of the installation method, the following are 
 
-Required:
-
-* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) v4.55
-  * On Windows, [WinGLPK](http://winglpk.sourceforge.net/)
-
 Optional:
 
-* [Java Platform (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) v7+, 32bit
+* [Java Platform (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) v8+, 32bit
   * needed only for running XML output validation
 * [Alloy4.1 and/or Alloy4.2](http://alloy.mit.edu/alloy/download.html)
   * needed only for Alloy output validation
 * [GraphViz](http://graphviz.org/)
   * the program `dot` is needed only in the `html` mode for SVG graph generation
 
-### Installation of GLPK
-
-On Linux
-
-1. [libglpk-dev](http://www.gnu.org/software/glpk/) v4.55
-  * execute `sudo apt-get install libglpk-dev` on Ubuntu
-2. [libgmp-dev](http://gmplib.org/)
-  * execute `sudo apt-get install libgmp-dev` on Ubuntu
-
-On Windows
-
-1. The binary distribution already includes the GNU Linear Programming Kit DLL `glpk_4_55.dll`.
-2. Install [WinGLPK](http://winglpk.sourceforge.net/) v4.55
-  * inside the `w64` folder, copy `glpk_4_55.dll` to `glpk.dll` so that it can be found when building Haskell package `glpk-hs`
-  * from `w64` folder, copy `glpk_4_55.dll` to `<user>\AppData\Roaming\cabal\bin`
-
-On Mac
-
-1. install GPLK 4.55 from [MacPorts](http://www.macports.org/)
-  * execute `sudo port install glpk +universal`
-
 ### Installation from binaries
 
-Binary distributions of the release 0.3.8 of Clafer Tools for Windows, Mac, and Linux, 
+Binary distributions of the release 0.3.9 of Clafer Tools for Windows, Mac, and Linux, 
 can be downloaded from 
 [Clafer Tools - Binary Distributions](http://http://gsd.uwaterloo.ca/clafer-tools-binary-distributions). 
 
@@ -106,28 +80,23 @@
 
 Dependencies
 
-* [The Haskell Platform](http://hackage.haskell.org/platform/) v2014.2.0.0 64bit
-  * on Windows, use 32bit
+* [The Haskell Platform](http://hackage.haskell.org/platform/) v2014.2.0.0 
+  * Alternatively GHC >= 7.8.3 and Cabal >= 1.18
 
-Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.8/) and it can be installed using
+Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.9/) and it can be installed using
 
 1. `cabal update`
 2. `cabal install clafer`
-3. `cd <cabal's lib or share folder>`  (`C:\Users\<user>\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\clafer-0.3.8` on Windows or `.cabal/share/x86_64-linux-ghc-7.8.3/clafer-0.3.8/` on Linux)
+3. `cd <cabal's lib or share folder>`  (`C:\Users\<user>\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\clafer-0.3.9` on Windows or `.cabal/share/x86_64-linux-ghc-7.8.3/clafer-0.3.9/` on Linux)
 4. to automatically download Alloy jars
   * execute `make` in `tools` 
 
-On Windows 
-
-* copy GLPK's dll `glpk_4_55.dll` to the `C:\Users\<user>\AppData\Roaming\cabal\bin` folder or any other folder on the system `PATH`
-
 ### Installation from the source code
 
 Dependencies
 
-* [The Haskell Platform](http://hackage.haskell.org/platform/) v2014.2.0.0 64bit
-  * on Windows, use 32bit
-  * Cabal >= 1.18
+* [The Haskell Platform](http://hackage.haskell.org/platform/) v2014.2.0.0 
+  * Alternatively GHC >= 7.8.3 and Cabal >= 1.18
 * [Alloy4.1 and/or Alloy4.2](http://alloy.mit.edu/alloy/download.html)
   * downloaded automatically during the build
 * [Git](http://git-scm.com/)
@@ -156,18 +125,13 @@
   * `git clone git://github.com/gsdlab/clafer.git`
 4. in `<source directory>/clafer`, execute
   * `cabal update`
-5. On Linux and Mac execute 
   * `make init`
   * `make`
-6. On Windows (in MSYS2 console), execute 
-  * `make glpk=/c/<your WinGLPK install dir>`
 
 ### Installation
 
-1. On Linux and Mac execute 
+1. Execute 
   * `make install to=<target directory>` 
-2. On Windows (in MSYS2 console), execute 
-  * `make glpk=/c/<your WinGLPK instal dir> to=/c/Users/<your user name>/AppData/Roaming/cabal/bin`
 
 #### Note: 
 > On Windows, use `/` with the `make` command instead of `\`.
@@ -191,7 +155,7 @@
 (As printed by `clafer --help`)
 
 ```
-Clafer 0.3.8
+Clafer 0.3.9
 
 clafer [OPTIONS] [FILE]
 
@@ -259,7 +223,7 @@
   -e --ecore2clafer                       Translate an ECore model into
                                           Clafer.
      --ss=SCOPESTRATEGY --scope-strategy  Use scope computation strategy:
-                                          none, simple (default), or full.
+                                          none or simple (default).
      --check-afm --afm                    Throws an error if the cardinality
                                           of any of the clafers is above 1.
      --sg --skip-goals                    Skip generation of Alloy code for
@@ -282,7 +246,7 @@
 
 `clafer model.cfr -m alloy -m xml -m html -m graph --self-contained --show-references --no-stats`
 
-The mode `-m alloy42` is only a default mode if no other modes are given. When other modes are given, the mode `-m alloy42` must be added explicitly if needed.
+The mode `-m alloy42` is only the default mode if no other modes are given. When other modes are given, the mode `-m alloy42` must be added explicitly if needed.
 
 Additionally, `[OPTIONS]` can also be specified directly in the model file by inserting the following compiler directive as the first line of the file:
 
@@ -316,12 +280,5 @@
 
 Need help?
 ==========
-* See [language's website](http://clafer.org) for news, technical reports and more
-  * Check out a [Learning Clafer section](http://t3-necsis.cs.uwaterloo.ca:8091/#Learning Clafer)
-  * Try a live instance of [ClaferWiki](http://t3-necsis.cs.uwaterloo.ca:8091) which contains a repository of models for various applications
-  * Try a live instance of [ClaferIDE](http://t3-necsis.cs.uwaterloo.ca:8094)
-  * Try a live instance of [ClaferConfigurator](http://t3-necsis.cs.uwaterloo.ca:8093)
-  * Try a live instance of [ClaferMooVisualizer](http://t3-necsis.cs.uwaterloo.ca:8092)
-* Take a look at (incomplete) [Clafer by examples wiki](https://github.com/gsdlab/clafer/wiki)
-* Browse example models in the [test suite](https://github.com/gsdlab/clafer/tree/master/test/positive) and [MOO examples](https://github.com/gsdlab/clafer/tree/master/spl_configurator/dataset)
-* Post questions, report bugs, suggest improvements [GSD Lab Bug Tracker](http://gsd.uwaterloo.ca:8888/questions/). Tag your entries with `clafer` (so that we know what they are related to) and with `jimmy-liang` or `michal` (so that Jimmy or Michał gets a notification).
+* Visit [language's website](http://clafer.org).
+* Report issues to [issue tracker](https://github.com/gsdlab/clafer/issues)
diff --git a/clafer.cabal b/clafer.cabal
--- a/clafer.cabal
+++ b/clafer.cabal
@@ -1,168 +1,165 @@
-Name:               clafer
-Version:            0.3.8
-Synopsis:           clafer compiles Clafer models to other formats, such as Alloy, XML, HTML, Dot.
-Description:        Clafer is a general purpose, lightweight, structural modeling language developed at GSD Lab, University of Waterloo. Lightweight modeling aims at improving the understanding of the problem domain in the early stages of software development and determining the requirements with fewer defects. Clafer's goal is to make modeling more accessible to a wider range of users and domains. The tool provides a reference language implementation. It translates models to other formats (e.g. Alloy, XML) to allow for reasoning with existing tools.
-Homepage:           http://clafer.org
-License:            MIT
-License-file:       LICENSE
-Author:             Kacper Bak, Jimmy Liang, Michal Antkiewicz, Ed Zulkoski, Luke Michael Brown, Paulius Juodisius, Rafael Olaechea
-Maintainer:         Michal Antkiewicz <mantkiew@gsd.uwaterloo.ca>
-Stability:          Experimental
-Category:           Model
-Build-type:         Simple
-Cabal-version:      >= 1.18
-data-files:         README.md,
-                    CHANGES.md,
-                    logo.pdf,
-                    Makefile,
-                    tools/XsdCheck.java,
-                    tools/XsdCheck.class,
-                    tools/ecore2clafer.jar,
-                    tools/Makefile
+Name:                   clafer
+Version:                0.3.9
+Synopsis:               clafer compiles Clafer models to other formats, such as Alloy, XML, HTML, Dot.
+Description:            Clafer is a general purpose, lightweight, structural modeling language developed at GSD Lab, University of Waterloo, and MODELS group at IT University of Copenhagen. Lightweight modeling aims at improving the understanding of the problem domain in the early stages of software development and determining the requirements with fewer defects. Clafer's goal is to make modeling more accessible to a wider range of users and domains. The tool provides a reference language implementation. It translates models to other formats (e.g. Alloy, XML) to allow for reasoning with existing tools.
+Homepage:               http://clafer.org
+License:                MIT
+License-file:           LICENSE
+Author:                 Kacper Bak, Jimmy Liang, Michal Antkiewicz, Ed Zulkoski, Luke Michael Brown, Paulius Juodisius, Rafael Olaechea
+Maintainer:             Michal Antkiewicz <mantkiew@gsd.uwaterloo.ca>
+Stability:              Experimental
+Category:               Model
+Build-type:             Simple
+Cabal-version:          >= 1.18
+data-files:             README.md
+                        , CHANGES.md
+                        , logo.pdf
+                        , Makefile
+                        , tools/XsdCheck.java
+                        , tools/XsdCheck.class
+                        , tools/ecore2clafer.jar
+                        , tools/Makefile
 source-repository head
-    type:           git
-    location:       git://github.com/gsdlab/clafer.git
+    type:               git
+    location:           git://github.com/gsdlab/clafer.git
 Executable clafer
-    build-tools:    ghc >= 7.6.3
+    build-tools:        ghc >= 7.8.3
     default-language:
-                    Haskell2010
-    default-extensions:
-                    DeriveDataTypeable,
-                    RankNTypes
-    main-is:        clafer.hs
-    hs-source-dirs: src-cmd
-    build-depends:  base >= 4.6.0.1 && < 5,
-                    containers >= 0.5.0.0,
-                    filepath >= 1.3.0.1,
-                    process >= 1.1.0.2,
+                        Haskell2010
+    default-extensions: DeriveDataTypeable
+                      , RankNTypes
+    main-is:            clafer.hs
+    hs-source-dirs:     src-cmd
+    build-depends:      base >= 4.7.0.1 && < 5
+                      , containers >= 0.5.5.1
+                      , filepath >= 1.3.0.2
+                      , process >= 1.1.0.2
 
-                    mtl >= 2.1.2,
-                    cmdargs >= 0.10.7,
-                    split >= 0.2.2,
+                      , mtl >= 2.1.3.1
 
-                    clafer == 0.3.8
+                      , cmdargs >= 0.10.7
+                      , split >= 0.2.2
+
+                      , clafer == 0.3.9
     if os(windows)
-        build-depends: HaXml == 1.24
+        build-depends:  HaXml == 1.24
     else
-        build-depends: HaXml >= 1.24
+        build-depends:  HaXml >= 1.24
 
-    other-modules: Paths_clafer
+    other-modules:      Paths_clafer
 
 library
-    build-tools:    ghc >= 7.6.3
-    default-language:
-                    Haskell2010
-    default-extensions:
-                    DeriveDataTypeable,
-                    RankNTypes
-    build-depends:  array >= 0.4.0.1,
-                    base >= 4.6.0.1 && < 5,
-                    containers >= 0.5.0.0,
-                    directory >= 1.2.0.1,
-                    filepath >= 1.3.0.1,
-                    process >= 1.1.0.2,
-                    network < 2.6,
-                    HTTP,
-                    bytestring,
+    build-tools:        ghc >= 7.8.3
+    default-language:   Haskell2010
+    default-extensions: DeriveDataTypeable
+                      , RankNTypes
+    build-depends:      array >= 0.4.0.1
+                      , base >= 4.7.0.1 && < 5
+                      , bytestring >= 0.10.4.0
+                      , containers >= 0.5.5.1
+                      , directory >= 1.2.1.0
+                      , filepath >= 1.3.0.2
+                      , process >= 1.1.0.2
+                      , transformers >= 0.3.0.0
 
-                    mtl >= 2.1.2,
-                    parsec >= 3.1.3,
-                    transformers >= 0.3.0.0,
+                      , HTTP >= 4000.2.10
+                      , mtl >= 2.1.3.1
+                      , network >= 2.6
+                      , parsec >= 3.1.3
+                      , text >= 1.1.0.0
 
-                    data-stringmap >= 1.0.1.1,
-                    aeson >= 0.7.0.6,
-                    json-builder >= 0.3,
-                    lens >= 4.1.1 && < 4.4,
-                    string-conversions >= 0.3.0.2,
-                    cmdargs >= 0.10.7,
-                    executable-path >= 0.0.3,
-                    glpk-hs >= 0.3.4,
-                    MaybeT >= 0.1.2,
-                    split >= 0.2.2,
-                    text >= 0.11.3.1
 
+                      , aeson >= 0.7.0.6
+                      , cmdargs >= 0.10.7
+                      , data-stringmap >= 1.0.1.1
+                      , executable-path >= 0.0.3
+                      , json-builder >= 0.3
+                      , lens >= 4.7
+                      , lens-aeson >= 1.0.0.3
+                      , network-uri >= 2.6
+                      , string-conversions >= 0.3.0.2
+                      , split >= 0.2.2
+
     if os(windows)
-        build-depends: HaXml == 1.24
+        build-depends:  HaXml == 1.24
     else
-        build-depends: HaXml >= 1.24
+        build-depends:  HaXml >= 1.24
 
-    hs-source-dirs:  src
-    ghc-options:     -Wall -fno-warn-unused-do-bind -fno-warn-orphans
-    exposed-modules:
-                     Language.Clafer,
-                     Language.ClaferT,
-                     Language.Clafer.ClaferArgs,
-                     Language.Clafer.Comments,
-                     Language.Clafer.Common,
-                     Language.Clafer.Css,
-                     Language.Clafer.JSONMetaData,
-                     Language.Clafer.QNameUID,
-                     Language.Clafer.Front.Absclafer,
-                     Language.Clafer.Front.ErrM,
-                     Language.Clafer.Front.LayoutResolver,
-                     Language.Clafer.Front.Lexclafer,
-                     Language.Clafer.Front.Parclafer,
-                     Language.Clafer.Front.Printclafer,
-                     Language.Clafer.Generator.Alloy,
-                     Language.Clafer.Generator.Choco,
-                     Language.Clafer.Generator.Concat,
-                     Language.Clafer.Generator.Graph,
-                     Language.Clafer.Generator.Html,
-                     Language.Clafer.Generator.Python,
-                     Language.Clafer.Generator.Schema,
-                     Language.Clafer.Generator.Stats,
-                     Language.Clafer.Generator.Xml,
-                     Language.Clafer.Intermediate.Analysis,
-                     Language.Clafer.Intermediate.Desugarer,
-                     Language.Clafer.Intermediate.Intclafer,
-                     Language.Clafer.Intermediate.Resolver,
-                     Language.Clafer.Intermediate.ResolverInheritance,
-                     Language.Clafer.Intermediate.ResolverName,
-                     Language.Clafer.Intermediate.ResolverType,
-                     Language.Clafer.Intermediate.ScopeAnalysis,
-                     Language.Clafer.Intermediate.SimpleScopeAnalyzer,
-                     Language.Clafer.Intermediate.GLPKScopeAnalyzer,
-                     Language.Clafer.Intermediate.StringAnalyzer,
-                     Language.Clafer.Intermediate.Tracing,
-                     Language.Clafer.Intermediate.Transformer,
-                     Language.Clafer.Optimizer.Optimizer,
-                     Language.Clafer.SplitJoin
-    other-modules: Paths_clafer,
-                   GetURL
+    hs-source-dirs:     src
+    ghc-options:        -Wall -fno-warn-unused-do-bind -fno-warn-orphans
+    exposed-modules:    Language.Clafer
+                      , Language.ClaferT
+                      , Language.Clafer.ClaferArgs
+                      , Language.Clafer.Comments
+                      , Language.Clafer.Common
+                      , Language.Clafer.Css
+                      , Language.Clafer.JSONMetaData
+                      , Language.Clafer.QNameUID
+                      , Language.Clafer.Front.AbsClafer
+                      , Language.Clafer.Front.ErrM
+                      , Language.Clafer.Front.LayoutResolver
+                      , Language.Clafer.Front.LexClafer
+                      , Language.Clafer.Front.ParClafer
+                      , Language.Clafer.Front.PrintClafer
+                      , Language.Clafer.Generator.Alloy
+                      , Language.Clafer.Generator.Choco
+                      , Language.Clafer.Generator.Concat
+                      , Language.Clafer.Generator.Graph
+                      , Language.Clafer.Generator.Html
+                      , Language.Clafer.Generator.Python
+                      , Language.Clafer.Generator.Schema
+                      , Language.Clafer.Generator.Stats
+                      , Language.Clafer.Generator.Xml
+                      , Language.Clafer.Intermediate.Desugarer
+                      , Language.Clafer.Intermediate.Intclafer
+                      , Language.Clafer.Intermediate.Resolver
+                      , Language.Clafer.Intermediate.ResolverInheritance
+                      , Language.Clafer.Intermediate.ResolverName
+                      , Language.Clafer.Intermediate.ResolverType
+                      , Language.Clafer.Intermediate.ScopeAnalysis
+                      , Language.Clafer.Intermediate.SimpleScopeAnalyzer
+                      , Language.Clafer.Intermediate.StringAnalyzer
+                      , Language.Clafer.Intermediate.Tracing
+                      , Language.Clafer.Intermediate.Transformer
+                      , Language.Clafer.Optimizer.Optimizer
+                      , Language.Clafer.SplitJoin
+    other-modules:      Paths_clafer
+                      , GetURL
 
 Test-Suite test-suite
-    build-tools:    ghc >= 7.6.3
-    default-language:
-                    Haskell2010
-    type:           exitcode-stdio-1.0
-    main-is:        test-suite.hs
-    hs-source-dirs: test
-    build-depends:
-                    base >= 4.6.0.1 && < 5,
-                    containers >= 0.5.0.0,
-                    directory >= 1.2.0.1,
-                    filepath >= 1.3.0.1,
+    build-tools:        ghc >= 7.8.3
+    default-language:   Haskell2010
+    type:               exitcode-stdio-1.0
+    main-is:            test-suite.hs
+    hs-source-dirs:     test
+    build-depends:      base >= 4.7.0.1 && < 5
+                      , containers >= 0.5.5.1
+                      , directory >= 1.2.1.0
+                      , filepath >= 1.3.0.2
 
-                    HUnit >= 1.2.5.2,
-                    mtl >= 2.1.2,
-                    QuickCheck >= 2.6,
+                      , HUnit >= 1.2.5.2
+                      , mtl >= 2.1.3.1
+                      , QuickCheck >= 2.6
 
-                    lens >= 4.1.1 && < 4.4,
-                    tasty >= 0.10,
-                    tasty-hunit >= 0.9,
-                    tasty-th >= 0.1.2,
+                      , data-stringmap >= 1.0.1.1
+                      , lens >= 4.7
+                      , lens-aeson >= 1.0.0.3
+                      , tasty >= 0.10
+                      , tasty-hunit >= 0.9
+                      , tasty-th >= 0.1.2
 
-                    clafer == 0.3.8
+                      , clafer == 0.3.9
 
     if os(windows)
-        build-depends: HaXml == 1.24
+        build-depends:  HaXml == 1.24
     else
-        build-depends: HaXml >= 1.24
+        build-depends:  HaXml >= 1.24
 
-    ghc-options:    -Wall -fno-warn-unused-do-bind -fno-warn-orphans
+    ghc-options:        -Wall -fno-warn-unused-do-bind -fno-warn-orphans
 
-    other-modules:  Paths_clafer,
-                    Functions,
-                    Suite.Positive,
-                    Suite.Negative,
-                    Suite.SimpleScopeAnalyser
+    other-modules:      Paths_clafer
+                      , Functions
+                      , Suite.Positive
+                      , Suite.Negative
+                      , Suite.SimpleScopeAnalyser
+                      , Suite.Redefinition
diff --git a/dist/build/Language/Clafer/Front/LexClafer.hs b/dist/build/Language/Clafer/Front/LexClafer.hs
new file mode 100644
--- /dev/null
+++ b/dist/build/Language/Clafer/Front/LexClafer.hs
@@ -0,0 +1,386 @@
+{-# LANGUAGE CPP,MagicHash #-}
+{-# LINE 3 "src\Language\Clafer\Front\LexClafer.x" #-}
+
+{-# OPTIONS -fno-warn-incomplete-patterns #-}
+{-# OPTIONS_GHC -w #-}
+module Language.Clafer.Front.LexClafer where
+
+
+
+import qualified Data.Bits
+import Data.Word (Word8)
+
+#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# "\xf8\xff\xff\xff\x4c\x00\x00\x00\xcc\x00\x00\x00\x4c\x01\x00\x00\x4c\x02\x00\x00\x0c\x02\x00\x00\x00\x00\x00\x00\x7d\x02\x00\x00\x7d\x03\x00\x00\x34\x00\x00\x00\x3d\x03\x00\x00\x13\x04\x00\x00\x00\x00\x00\x00\x7f\x03\x00\x00\x93\x04\x00\x00\x08\x05\x00\x00\xd9\xff\xff\xff\x4d\x00\x00\x00\x61\x00\x00\x00\xe1\xff\xff\xff\x08\x06\x00\x00\xc8\x05\x00\x00\x00\x00\x00\x00\xbe\x06\x00\x00\x00\x00\x00\x00\x7e\x00\x00\x00\xed\xff\xff\xff\xdd\xff\xff\xff\x4f\x00\x00\x00\xd6\xff\xff\xff\xd7\xff\xff\xff\x00\x00\x00\x00\x9a\xff\xff\xff\xfa\xff\xff\xff\x3d\x00\x00\x00\xf1\xff\xff\xff\x2d\x00\x00\x00\x79\x00\x00\x00\x99\x06\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x97\x07\x00\x00"#
+
+alex_table :: AlexAddr
+alex_table = AlexA# "\x00\x00\x19\x00\x19\x00\x19\x00\x19\x00\x19\x00\x12\x00\x1f\x00\x1f\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x1f\x00\x1f\x00\x1f\x00\x1f\x00\x0b\x00\x19\x00\x1d\x00\x0f\x00\x1f\x00\x17\x00\x1f\x00\x13\x00\x1f\x00\x1f\x00\x1f\x00\x24\x00\x1b\x00\x1f\x00\x1c\x00\x23\x00\x1a\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x1e\x00\x1f\x00\x22\x00\x21\x00\x1e\x00\x1f\x00\x1f\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x1f\x00\x1f\x00\x1f\x00\x0f\x00\x1f\x00\x1f\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x1f\x00\x20\x00\x1f\x00\x01\x00\x1f\x00\x00\x00\x1f\x00\x21\x00\x18\x00\x1f\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x19\x00\x19\x00\x19\x00\x19\x00\x19\x00\x00\x00\x21\x00\x00\x00\x00\x00\x0f\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x0f\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\x00\x05\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x02\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\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\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\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\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\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\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\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\xff\xff\xff\xff\xff\xff\x0d\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\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\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\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\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\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\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\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\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\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\x15\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\x00\x05\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x28\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x08\x00\x0a\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\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\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\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\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\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\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\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x14\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x16\x00\x15\x00\x02\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0d\x00\x03\x00\x06\x00\x06\x00\x06\x00\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x00\x00\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+alex_check :: AlexAddr
+alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x2d\x00\x26\x00\x2b\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3d\x00\x3d\x00\x3e\x00\x7c\x00\x2a\x00\x20\x00\x21\x00\x22\x00\x23\x00\x2f\x00\x25\x00\x26\x00\x2e\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\x3e\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x22\x00\x2a\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x2a\x00\x3a\x00\xff\xff\x3c\x00\x3d\x00\x2f\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\xff\xff\x3e\x00\xff\xff\xff\xff\x5c\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x74\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2a\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\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\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x22\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xff\xff\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\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\x5c\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\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\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\x65\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\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\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\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\xc3\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
+
+alex_deflt :: AlexAddr
+alex_deflt = AlexA# "\xff\xff\x0b\x00\xff\xff\xff\xff\x0b\x00\x0b\x00\x0c\x00\x0c\x00\x0f\x00\xff\xff\x0f\x00\x0b\x00\x16\x00\x16\x00\xff\xff\x0f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x17\x00\x17\x00\x17\x00\x17\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"#
+
+alex_accept = listArray (0::Int,41) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_4),AlexAcc (alex_action_5),AlexAcc (alex_action_5),AlexAcc (alex_action_6),AlexAcc (alex_action_7)]
+{-# LINE 42 "src\Language\Clafer\Front\LexClafer.x" #-}
+
+
+tok :: (Posn -> String -> Token) -> (Posn -> String -> Token)
+tok f p s = f p s
+
+share :: String -> String
+share = id
+
+data Tok =
+   TS !String !Int    -- reserved words and symbols
+ | TL !String         -- string literals
+ | TI !String         -- integer literals
+ | TV !String         -- identifiers
+ | TD !String         -- double precision float literals
+ | TC !String         -- character literals
+ | T_PosInteger !String
+ | T_PosDouble !String
+ | T_PosString !String
+ | T_PosIdent !String
+
+ deriving (Eq,Show,Ord)
+
+data Token =
+   PT  Posn Tok
+ | Err Posn
+  deriving (Eq,Show,Ord)
+
+tokenPos :: [Token] -> String
+tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
+tokenPos _ = "end of file"
+
+tokenPosn :: Token -> Posn
+tokenPosn (PT p _) = p
+tokenPosn (Err p) = p
+
+tokenLineCol :: Token -> (Int, Int)
+tokenLineCol = posLineCol . tokenPosn
+
+posLineCol :: Posn -> (Int, Int)
+posLineCol (Pn _ l c) = (l,c)
+
+mkPosToken :: Token -> ((Int, Int), String)
+mkPosToken t@(PT p _) = (posLineCol p, prToken t)
+
+prToken :: Token -> String
+prToken t = case t of
+  PT _ (TS s _) -> s
+  PT _ (TL s)   -> show s
+  PT _ (TI s)   -> s
+  PT _ (TV s)   -> s
+  PT _ (TD s)   -> s
+  PT _ (TC s)   -> s
+  PT _ (T_PosInteger s) -> s
+  PT _ (T_PosDouble s) -> s
+  PT _ (T_PosString s) -> s
+  PT _ (T_PosIdent s) -> s
+
+
+data BTree = N | B String Tok BTree BTree deriving (Show)
+
+eitherResIdent :: (String -> Tok) -> String -> Tok
+eitherResIdent tv s = treeFind resWords
+  where
+  treeFind N = tv s
+  treeFind (B a t left right) | s < a  = treeFind left
+                              | s > a  = treeFind right
+                              | s == a = t
+
+resWords :: BTree
+resWords = b ">>" 33 (b "." 17 (b "**" 9 (b "&&" 5 (b "#" 3 (b "!=" 2 (b "!" 1 N N) N) (b "%" 4 N N)) (b ")" 7 (b "(" 6 N N) (b "*" 8 N N))) (b "-" 13 (b "++" 11 (b "+" 10 N N) (b "," 12 N N)) (b "->" 15 (b "--" 14 N N) (b "->>" 16 N N)))) (b "<:" 25 (b ":=" 21 (b "/" 19 (b ".." 18 N N) (b ":" 20 N N)) (b ";" 23 (b ":>" 22 N N) (b "<" 24 N N))) (b "=" 29 (b "<=" 27 (b "<<" 26 N N) (b "<=>" 28 N N)) (b ">" 31 (b "=>" 30 N N) (b ">=" 32 N N))))) (b "min" 49 (b "assert" 41 (b "]" 37 (b "[" 35 (b "?" 34 N N) (b "\\" 36 N N)) (b "abstract" 39 (b "`" 38 N N) (b "all" 40 N N))) (b "if" 45 (b "else" 43 (b "disj" 42 N N) (b "enum" 44 N N)) (b "lone" 47 (b "in" 46 N N) (b "max" 48 N N)))) (b "some" 57 (b "one" 53 (b "no" 51 (b "mux" 50 N N) (b "not" 52 N N)) (b "or" 55 (b "opt" 54 N N) (b "product" 56 N N))) (b "{" 61 (b "then" 59 (b "sum" 58 N N) (b "xor" 60 N N)) (b "||" 63 (b "|" 62 N N) (b "}" 64 N N)))))
+   where b s n = let bs = id s
+                  in B bs (TS bs n)
+
+unescapeInitTail :: String -> String
+unescapeInitTail = id . unesc . tail . id where
+  unesc s = case s of
+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
+    '\\':'n':cs  -> '\n' : unesc cs
+    '\\':'t':cs  -> '\t' : unesc cs
+    '"':[]    -> []
+    c:cs      -> c : unesc cs
+    _         -> []
+
+-------------------------------------------------------------------
+-- Alex wrapper code.
+-- A modified "posn" wrapper.
+-------------------------------------------------------------------
+
+data Posn = Pn !Int !Int !Int
+      deriving (Eq, Show,Ord)
+
+alexStartPos :: Posn
+alexStartPos = Pn 0 1 1
+
+alexMove :: Posn -> Char -> Posn
+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
+
+type Byte = Word8
+
+type AlexInput = (Posn,     -- current position,
+                  Char,     -- previous char
+                  [Byte],   -- pending bytes on the current char
+                  String)   -- current input string
+
+tokens :: String -> [Token]
+tokens str = go (alexStartPos, '\n', [], str)
+    where
+      go :: AlexInput -> [Token]
+      go inp@(pos, _, _, str) =
+               case alexScan inp 0 of
+                AlexEOF                   -> []
+                AlexError (pos, _, _, _)  -> [Err pos]
+                AlexSkip  inp' len        -> go inp'
+                AlexToken inp' len act    -> act pos (take len str) : (go inp')
+
+alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
+alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
+alexGetByte (p, _, [], s) =
+  case  s of
+    []  -> Nothing
+    (c:s) ->
+             let p'     = alexMove p c
+                 (b:bs) = utf8Encode c
+              in p' `seq` Just (b, (p', c, bs, s))
+
+alexInputPrevChar :: AlexInput -> Char
+alexInputPrevChar (p, c, bs, s) = c
+
+-- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
+utf8Encode :: Char -> [Word8]
+utf8Encode = map fromIntegral . go . ord
+ where
+  go oc
+   | oc <= 0x7f       = [oc]
+
+   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+
+   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+
+alex_action_3 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
+alex_action_4 =  tok (\p s -> PT p (eitherResIdent (T_PosInteger . share) s)) 
+alex_action_5 =  tok (\p s -> PT p (eitherResIdent (T_PosDouble . share) s)) 
+alex_action_6 =  tok (\p s -> PT p (eitherResIdent (T_PosString . share) s)) 
+alex_action_7 =  tok (\p s -> PT p (eitherResIdent (T_PosIdent . share) s)) 
+alex_action_8 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
+{-# 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))
+{-# LINE 198 "templates\\GenericTemplate.hs" #-}
+
+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
+{-# LINE 242 "templates\\GenericTemplate.hs" #-}
+
+-- used by wrappers
+iUnbox (I# (i)) = i
diff --git a/dist/build/Language/Clafer/Front/Lexclafer.hs b/dist/build/Language/Clafer/Front/Lexclafer.hs
deleted file mode 100644
--- a/dist/build/Language/Clafer/Front/Lexclafer.hs
+++ /dev/null
@@ -1,375 +0,0 @@
-{-# LANGUAGE CPP,MagicHash #-}
-{-# LINE 3 "src\Language\Clafer\Front\Lexclafer.x" #-}
-
-{-# OPTIONS -fno-warn-incomplete-patterns #-}
-{-# OPTIONS_GHC -w #-}
-module Language.Clafer.Front.Lexclafer where
-
-
-
-import qualified Data.Bits
-import Data.Word (Word8)
-
-#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# "\xf8\xff\xff\xff\x4c\x00\x00\x00\x22\x01\x00\x00\xa2\x01\x00\x00\x22\x02\x00\x00\x22\x03\x00\x00\x92\x00\x00\x00\x00\x00\x00\x00\x13\x03\x00\x00\x13\x04\x00\x00\x34\x00\x00\x00\xd3\x03\x00\x00\xa9\x04\x00\x00\x00\x00\x00\x00\x15\x04\x00\x00\x29\x05\x00\x00\x9e\x05\x00\x00\xd9\xff\xff\xff\x4d\x00\x00\x00\x61\x00\x00\x00\xe1\xff\xff\xff\x9e\x06\x00\x00\x5e\x06\x00\x00\x00\x00\x00\x00\x54\x07\x00\x00\x00\x00\x00\x00\x2a\x08\x00\x00\x7e\x00\x00\x00\xed\xff\xff\xff\xdd\xff\xff\xff\x4f\x00\x00\x00\xd6\xff\xff\xff\xd7\xff\xff\xff\x00\x00\x00\x00\x9a\xff\xff\xff\xdf\xff\xff\xff\x3d\x00\x00\x00\xf1\xff\xff\xff\x0e\x00\x00\x00\x79\x00\x00\x00\x2f\x07\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x03\x09\x00\x00"#
-
-alex_table :: AlexAddr
-alex_table = AlexA# "\x00\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x13\x00\x21\x00\x21\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x21\x00\x21\x00\x21\x00\x21\x00\x0c\x00\x1b\x00\x1f\x00\x10\x00\x21\x00\x18\x00\x21\x00\x14\x00\x21\x00\x21\x00\x21\x00\x26\x00\x1d\x00\x21\x00\x1e\x00\x25\x00\x1c\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x20\x00\x21\x00\x24\x00\x23\x00\x20\x00\x21\x00\x21\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x21\x00\x21\x00\x21\x00\x10\x00\x00\x00\x21\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x21\x00\x22\x00\x21\x00\x02\x00\x21\x00\x00\x00\x21\x00\x23\x00\x19\x00\x21\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x1b\x00\x00\x00\x23\x00\x00\x00\x00\x00\x10\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x10\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x29\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x06\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x06\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x03\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\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\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\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\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\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\x0e\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\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\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\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\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\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\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\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\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\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\x16\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x06\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2a\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x00\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x00\x0b\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\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\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\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\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\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\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\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x17\x00\x16\x00\x03\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0e\x00\x04\x00\x07\x00\x07\x00\x07\x00\x08\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x06\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x00\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-alex_check :: AlexAddr
-alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x2d\x00\x26\x00\x2b\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3d\x00\x3d\x00\x3e\x00\x7c\x00\x2a\x00\x20\x00\x21\x00\x22\x00\x23\x00\x2f\x00\x3e\x00\x26\x00\x2e\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\x2a\x00\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x22\x00\xff\xff\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x2a\x00\x3a\x00\xff\xff\x3c\x00\x3d\x00\x2f\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\xff\xff\x3e\x00\xff\xff\xff\xff\x5c\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\xff\xff\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2e\x00\x74\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x2f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\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\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2a\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\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\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x22\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xff\xff\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\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\x5c\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\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\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x5b\x00\x5c\x00\x5d\x00\x5e\x00\x5f\x00\x60\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\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\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\x65\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x2a\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\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\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\xff\xff\xff\xff\xff\xff\xff\xff\x80\x00\x81\x00\x82\x00\x83\x00\x84\x00\x85\x00\x86\x00\x87\x00\x88\x00\x89\x00\x8a\x00\x8b\x00\x8c\x00\x8d\x00\x8e\x00\x8f\x00\x90\x00\x91\x00\x92\x00\x93\x00\x94\x00\x95\x00\x96\x00\x97\x00\x98\x00\x99\x00\x9a\x00\x9b\x00\x9c\x00\x9d\x00\x9e\x00\x9f\x00\xa0\x00\xa1\x00\xa2\x00\xa3\x00\xa4\x00\xa5\x00\xa6\x00\xa7\x00\xa8\x00\xa9\x00\xaa\x00\xab\x00\xac\x00\xad\x00\xae\x00\xaf\x00\xb0\x00\xb1\x00\xb2\x00\xb3\x00\xb4\x00\xb5\x00\xb6\x00\xb7\x00\xb8\x00\xb9\x00\xba\x00\xbb\x00\xbc\x00\xbd\x00\xbe\x00\xbf\x00\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\xd7\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\xf7\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x27\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\xff\xff\xff\xff\xff\xff\xff\xff\x5f\x00\xff\xff\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\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\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\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\xc3\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\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\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
-
-alex_deflt :: AlexAddr
-alex_deflt = AlexA# "\xff\xff\x0c\x00\x0c\x00\xff\xff\xff\xff\x0c\x00\x0c\x00\x0d\x00\x0d\x00\x10\x00\xff\xff\x10\x00\x0c\x00\x17\x00\x17\x00\xff\xff\x10\x00\xff\xff\xff\xff\xff\xff\xff\xff\x18\x00\x18\x00\x18\x00\x18\x00\xff\xff\x0c\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"#
-
-alex_accept = listArray (0::Int,43) [AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAccSkip,AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_3),AlexAcc (alex_action_4),AlexAcc (alex_action_5),AlexAcc (alex_action_5),AlexAcc (alex_action_6),AlexAcc (alex_action_7)]
-{-# LINE 42 "src\Language\Clafer\Front\Lexclafer.x" #-}
-
-
-tok f p s = f p s
-
-share :: String -> String
-share = id
-
-data Tok =
-   TS !String !Int    -- reserved words and symbols
- | TL !String         -- string literals
- | TI !String         -- integer literals
- | TV !String         -- identifiers
- | TD !String         -- double precision float literals
- | TC !String         -- character literals
- | T_PosInteger !String
- | T_PosDouble !String
- | T_PosString !String
- | T_PosIdent !String
-
- deriving (Eq,Show,Ord)
-
-data Token = 
-   PT  Posn Tok
- | Err Posn
-  deriving (Eq,Show,Ord)
-
-tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
-tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
-tokenPos _ = "end of file"
-
-tokenPosn (PT p _) = p
-tokenPosn (Err p) = p
-tokenLineCol = posLineCol . tokenPosn
-posLineCol (Pn _ l c) = (l,c)
-mkPosToken t@(PT p _) = (posLineCol p, prToken t)
-
-prToken t = case t of
-  PT _ (TS s _) -> s
-  PT _ (TL s)   -> s
-  PT _ (TI s)   -> s
-  PT _ (TV s)   -> s
-  PT _ (TD s)   -> s
-  PT _ (TC s)   -> s
-  PT _ (T_PosInteger s) -> s
-  PT _ (T_PosDouble s) -> s
-  PT _ (T_PosString s) -> s
-  PT _ (T_PosIdent s) -> s
-
-
-data BTree = N | B String Tok BTree BTree deriving (Show)
-
-eitherResIdent :: (String -> Tok) -> String -> Tok
-eitherResIdent tv s = treeFind resWords
-  where
-  treeFind N = tv s
-  treeFind (B a t left right) | s < a  = treeFind left
-                              | s > a  = treeFind right
-                              | s == a = t
-
-resWords = b ">>" 32 (b "." 16 (b "**" 8 (b "&&" 4 (b "!=" 2 (b "!" 1 N N) (b "#" 3 N N)) (b ")" 6 (b "(" 5 N N) (b "*" 7 N N))) (b "-" 12 (b "++" 10 (b "+" 9 N N) (b "," 11 N N)) (b "->" 14 (b "--" 13 N N) (b "->>" 15 N N)))) (b "<:" 24 (b ":=" 20 (b "/" 18 (b ".." 17 N N) (b ":" 19 N N)) (b ";" 22 (b ":>" 21 N N) (b "<" 23 N N))) (b "=" 28 (b "<=" 26 (b "<<" 25 N N) (b "<=>" 27 N N)) (b ">" 30 (b "=>" 29 N N) (b ">=" 31 N N))))) (b "min" 48 (b "assert" 40 (b "]" 36 (b "[" 34 (b "?" 33 N N) (b "\\" 35 N N)) (b "abstract" 38 (b "`" 37 N N) (b "all" 39 N N))) (b "if" 44 (b "else" 42 (b "disj" 41 N N) (b "enum" 43 N N)) (b "lone" 46 (b "in" 45 N N) (b "max" 47 N N)))) (b "sum" 56 (b "one" 52 (b "no" 50 (b "mux" 49 N N) (b "not" 51 N N)) (b "or" 54 (b "opt" 53 N N) (b "some" 55 N N))) (b "|" 60 (b "xor" 58 (b "then" 57 N N) (b "{" 59 N N)) (b "}" 62 (b "||" 61 N N) N))))
-   where b s n = let bs = id s
-                  in B bs (TS bs n)
-
-unescapeInitTail :: String -> String
-unescapeInitTail = id . unesc . tail . id where
-  unesc s = case s of
-    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
-    '\\':'n':cs  -> '\n' : unesc cs
-    '\\':'t':cs  -> '\t' : unesc cs
-    '"':[]    -> []
-    c:cs      -> c : unesc cs
-    _         -> []
-
--------------------------------------------------------------------
--- Alex wrapper code.
--- A modified "posn" wrapper.
--------------------------------------------------------------------
-
-data Posn = Pn !Int !Int !Int
-      deriving (Eq, Show,Ord)
-
-alexStartPos :: Posn
-alexStartPos = Pn 0 1 1
-
-alexMove :: Posn -> Char -> Posn
-alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
-alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
-alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
-
-type Byte = Word8
-
-type AlexInput = (Posn,     -- current position,
-                  Char,     -- previous char
-                  [Byte],   -- pending bytes on the current char
-                  String)   -- current input string
-
-tokens :: String -> [Token]
-tokens str = go (alexStartPos, '\n', [], str)
-    where
-      go :: AlexInput -> [Token]
-      go inp@(pos, _, _, str) =
-               case alexScan inp 0 of
-                AlexEOF                   -> []
-                AlexError (pos, _, _, _)  -> [Err pos]
-                AlexSkip  inp' len        -> go inp'
-                AlexToken inp' len act    -> act pos (take len str) : (go inp')
-
-alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
-alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
-alexGetByte (p, _, [], s) =
-  case  s of
-    []  -> Nothing
-    (c:s) ->
-             let p'     = alexMove p c
-                 (b:bs) = utf8Encode c
-              in p' `seq` Just (b, (p', c, bs, s))
-
-alexInputPrevChar :: AlexInput -> Char
-alexInputPrevChar (p, c, bs, s) = c
-
-  -- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
-utf8Encode :: Char -> [Word8]
-utf8Encode = map fromIntegral . go . ord
- where
-  go oc
-   | oc <= 0x7f       = [oc]
-
-   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-
-   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-
-alex_action_3 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
-alex_action_4 =  tok (\p s -> PT p (eitherResIdent (T_PosInteger . share) s)) 
-alex_action_5 =  tok (\p s -> PT p (eitherResIdent (T_PosDouble . share) s)) 
-alex_action_6 =  tok (\p s -> PT p (eitherResIdent (T_PosString . share) s)) 
-alex_action_7 =  tok (\p s -> PT p (eitherResIdent (T_PosIdent . share) s)) 
-alex_action_8 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) 
-{-# 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))
-{-# LINE 198 "templates\\GenericTemplate.hs" #-}
-
-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
-{-# LINE 242 "templates\\GenericTemplate.hs" #-}
-
--- used by wrappers
-iUnbox (I# (i)) = i
diff --git a/dist/build/Language/Clafer/Front/ParClafer.hs b/dist/build/Language/Clafer/Front/ParClafer.hs
new file mode 100644
--- /dev/null
+++ b/dist/build/Language/Clafer/Front/ParClafer.hs
@@ -0,0 +1,2045 @@
+{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -fglasgow-exts -cpp #-}
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
+module Language.Clafer.Front.ParClafer where
+import Language.Clafer.Front.AbsClafer
+import Language.Clafer.Front.LexClafer
+import Language.Clafer.Front.ErrM
+import qualified Data.Array as Happy_Data_Array
+import qualified GHC.Exts as Happy_GHC_Exts
+import Control.Applicative(Applicative(..))
+
+-- parser produced by Happy Version 1.19.4
+
+newtype HappyAbsSyn  = HappyAbsSyn HappyAny
+#if __GLASGOW_HASKELL__ >= 607
+type HappyAny = Happy_GHC_Exts.Any
+#else
+type HappyAny = forall a . a
+#endif
+happyIn8 :: (PosInteger) -> (HappyAbsSyn )
+happyIn8 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn8 #-}
+happyOut8 :: (HappyAbsSyn ) -> (PosInteger)
+happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut8 #-}
+happyIn9 :: (PosDouble) -> (HappyAbsSyn )
+happyIn9 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn9 #-}
+happyOut9 :: (HappyAbsSyn ) -> (PosDouble)
+happyOut9 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut9 #-}
+happyIn10 :: (PosString) -> (HappyAbsSyn )
+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn10 #-}
+happyOut10 :: (HappyAbsSyn ) -> (PosString)
+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut10 #-}
+happyIn11 :: (PosIdent) -> (HappyAbsSyn )
+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn11 #-}
+happyOut11 :: (HappyAbsSyn ) -> (PosIdent)
+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut11 #-}
+happyIn12 :: (Module) -> (HappyAbsSyn )
+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn12 #-}
+happyOut12 :: (HappyAbsSyn ) -> (Module)
+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut12 #-}
+happyIn13 :: (Declaration) -> (HappyAbsSyn )
+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn13 #-}
+happyOut13 :: (HappyAbsSyn ) -> (Declaration)
+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut13 #-}
+happyIn14 :: (Clafer) -> (HappyAbsSyn )
+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn14 #-}
+happyOut14 :: (HappyAbsSyn ) -> (Clafer)
+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut14 #-}
+happyIn15 :: (Constraint) -> (HappyAbsSyn )
+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn15 #-}
+happyOut15 :: (HappyAbsSyn ) -> (Constraint)
+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut15 #-}
+happyIn16 :: (SoftConstraint) -> (HappyAbsSyn )
+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn16 #-}
+happyOut16 :: (HappyAbsSyn ) -> (SoftConstraint)
+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut16 #-}
+happyIn17 :: (Goal) -> (HappyAbsSyn )
+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn17 #-}
+happyOut17 :: (HappyAbsSyn ) -> (Goal)
+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut17 #-}
+happyIn18 :: (Abstract) -> (HappyAbsSyn )
+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn18 #-}
+happyOut18 :: (HappyAbsSyn ) -> (Abstract)
+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut18 #-}
+happyIn19 :: (Elements) -> (HappyAbsSyn )
+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn19 #-}
+happyOut19 :: (HappyAbsSyn ) -> (Elements)
+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut19 #-}
+happyIn20 :: (Element) -> (HappyAbsSyn )
+happyIn20 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn20 #-}
+happyOut20 :: (HappyAbsSyn ) -> (Element)
+happyOut20 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut20 #-}
+happyIn21 :: (Super) -> (HappyAbsSyn )
+happyIn21 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn21 #-}
+happyOut21 :: (HappyAbsSyn ) -> (Super)
+happyOut21 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut21 #-}
+happyIn22 :: (Reference) -> (HappyAbsSyn )
+happyIn22 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn22 #-}
+happyOut22 :: (HappyAbsSyn ) -> (Reference)
+happyOut22 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut22 #-}
+happyIn23 :: (Init) -> (HappyAbsSyn )
+happyIn23 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn23 #-}
+happyOut23 :: (HappyAbsSyn ) -> (Init)
+happyOut23 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut23 #-}
+happyIn24 :: (InitHow) -> (HappyAbsSyn )
+happyIn24 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn24 #-}
+happyOut24 :: (HappyAbsSyn ) -> (InitHow)
+happyOut24 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut24 #-}
+happyIn25 :: (GCard) -> (HappyAbsSyn )
+happyIn25 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn25 #-}
+happyOut25 :: (HappyAbsSyn ) -> (GCard)
+happyOut25 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut25 #-}
+happyIn26 :: (Card) -> (HappyAbsSyn )
+happyIn26 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn26 #-}
+happyOut26 :: (HappyAbsSyn ) -> (Card)
+happyOut26 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut26 #-}
+happyIn27 :: (NCard) -> (HappyAbsSyn )
+happyIn27 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn27 #-}
+happyOut27 :: (HappyAbsSyn ) -> (NCard)
+happyOut27 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut27 #-}
+happyIn28 :: (ExInteger) -> (HappyAbsSyn )
+happyIn28 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn28 #-}
+happyOut28 :: (HappyAbsSyn ) -> (ExInteger)
+happyOut28 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut28 #-}
+happyIn29 :: (Name) -> (HappyAbsSyn )
+happyIn29 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn29 #-}
+happyOut29 :: (HappyAbsSyn ) -> (Name)
+happyOut29 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut29 #-}
+happyIn30 :: (Exp) -> (HappyAbsSyn )
+happyIn30 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn30 #-}
+happyOut30 :: (HappyAbsSyn ) -> (Exp)
+happyOut30 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut30 #-}
+happyIn31 :: (Exp) -> (HappyAbsSyn )
+happyIn31 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn31 #-}
+happyOut31 :: (HappyAbsSyn ) -> (Exp)
+happyOut31 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut31 #-}
+happyIn32 :: (Exp) -> (HappyAbsSyn )
+happyIn32 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn32 #-}
+happyOut32 :: (HappyAbsSyn ) -> (Exp)
+happyOut32 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut32 #-}
+happyIn33 :: (Exp) -> (HappyAbsSyn )
+happyIn33 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn33 #-}
+happyOut33 :: (HappyAbsSyn ) -> (Exp)
+happyOut33 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut33 #-}
+happyIn34 :: (Exp) -> (HappyAbsSyn )
+happyIn34 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn34 #-}
+happyOut34 :: (HappyAbsSyn ) -> (Exp)
+happyOut34 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut34 #-}
+happyIn35 :: (Exp) -> (HappyAbsSyn )
+happyIn35 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn35 #-}
+happyOut35 :: (HappyAbsSyn ) -> (Exp)
+happyOut35 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut35 #-}
+happyIn36 :: (Exp) -> (HappyAbsSyn )
+happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn36 #-}
+happyOut36 :: (HappyAbsSyn ) -> (Exp)
+happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut36 #-}
+happyIn37 :: (Exp) -> (HappyAbsSyn )
+happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn37 #-}
+happyOut37 :: (HappyAbsSyn ) -> (Exp)
+happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut37 #-}
+happyIn38 :: (Exp) -> (HappyAbsSyn )
+happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn38 #-}
+happyOut38 :: (HappyAbsSyn ) -> (Exp)
+happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut38 #-}
+happyIn39 :: (Exp) -> (HappyAbsSyn )
+happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn39 #-}
+happyOut39 :: (HappyAbsSyn ) -> (Exp)
+happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut39 #-}
+happyIn40 :: (Exp) -> (HappyAbsSyn )
+happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn40 #-}
+happyOut40 :: (HappyAbsSyn ) -> (Exp)
+happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut40 #-}
+happyIn41 :: (Exp) -> (HappyAbsSyn )
+happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn41 #-}
+happyOut41 :: (HappyAbsSyn ) -> (Exp)
+happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut41 #-}
+happyIn42 :: (Exp) -> (HappyAbsSyn )
+happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn42 #-}
+happyOut42 :: (HappyAbsSyn ) -> (Exp)
+happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut42 #-}
+happyIn43 :: (Exp) -> (HappyAbsSyn )
+happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn43 #-}
+happyOut43 :: (HappyAbsSyn ) -> (Exp)
+happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut43 #-}
+happyIn44 :: (SetExp) -> (HappyAbsSyn )
+happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn44 #-}
+happyOut44 :: (HappyAbsSyn ) -> (SetExp)
+happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut44 #-}
+happyIn45 :: (SetExp) -> (HappyAbsSyn )
+happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn45 #-}
+happyOut45 :: (HappyAbsSyn ) -> (SetExp)
+happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut45 #-}
+happyIn46 :: (SetExp) -> (HappyAbsSyn )
+happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn46 #-}
+happyOut46 :: (HappyAbsSyn ) -> (SetExp)
+happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut46 #-}
+happyIn47 :: (SetExp) -> (HappyAbsSyn )
+happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn47 #-}
+happyOut47 :: (HappyAbsSyn ) -> (SetExp)
+happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut47 #-}
+happyIn48 :: (SetExp) -> (HappyAbsSyn )
+happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn48 #-}
+happyOut48 :: (HappyAbsSyn ) -> (SetExp)
+happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut48 #-}
+happyIn49 :: (SetExp) -> (HappyAbsSyn )
+happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn49 #-}
+happyOut49 :: (HappyAbsSyn ) -> (SetExp)
+happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut49 #-}
+happyIn50 :: (SetExp) -> (HappyAbsSyn )
+happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn50 #-}
+happyOut50 :: (HappyAbsSyn ) -> (SetExp)
+happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut50 #-}
+happyIn51 :: (Decl) -> (HappyAbsSyn )
+happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn51 #-}
+happyOut51 :: (HappyAbsSyn ) -> (Decl)
+happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut51 #-}
+happyIn52 :: (Quant) -> (HappyAbsSyn )
+happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn52 #-}
+happyOut52 :: (HappyAbsSyn ) -> (Quant)
+happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut52 #-}
+happyIn53 :: (EnumId) -> (HappyAbsSyn )
+happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn53 #-}
+happyOut53 :: (HappyAbsSyn ) -> (EnumId)
+happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut53 #-}
+happyIn54 :: (ModId) -> (HappyAbsSyn )
+happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn54 #-}
+happyOut54 :: (HappyAbsSyn ) -> (ModId)
+happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut54 #-}
+happyIn55 :: (LocId) -> (HappyAbsSyn )
+happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn55 #-}
+happyOut55 :: (HappyAbsSyn ) -> (LocId)
+happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut55 #-}
+happyIn56 :: ([Declaration]) -> (HappyAbsSyn )
+happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn56 #-}
+happyOut56 :: (HappyAbsSyn ) -> ([Declaration])
+happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut56 #-}
+happyIn57 :: ([EnumId]) -> (HappyAbsSyn )
+happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn57 #-}
+happyOut57 :: (HappyAbsSyn ) -> ([EnumId])
+happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut57 #-}
+happyIn58 :: ([Element]) -> (HappyAbsSyn )
+happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn58 #-}
+happyOut58 :: (HappyAbsSyn ) -> ([Element])
+happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut58 #-}
+happyIn59 :: ([Exp]) -> (HappyAbsSyn )
+happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn59 #-}
+happyOut59 :: (HappyAbsSyn ) -> ([Exp])
+happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut59 #-}
+happyIn60 :: ([LocId]) -> (HappyAbsSyn )
+happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn60 #-}
+happyOut60 :: (HappyAbsSyn ) -> ([LocId])
+happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut60 #-}
+happyIn61 :: ([ModId]) -> (HappyAbsSyn )
+happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn61 #-}
+happyOut61 :: (HappyAbsSyn ) -> ([ModId])
+happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut61 #-}
+happyInTok :: (Token) -> (HappyAbsSyn )
+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyInTok #-}
+happyOutTok :: (HappyAbsSyn ) -> (Token)
+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOutTok #-}
+
+
+happyActOffsets :: HappyAddr
+happyActOffsets = HappyA# "\x00\x00\x33\x01\x34\x01\x25\x01\x19\x01\x0b\x01\x00\x00\xf0\x00\x00\x00\xf0\x00\x0e\x01\xef\x00\x00\x00\xef\x00\x80\x01\x00\x00\xef\x00\x9d\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xee\x00\xee\x00\x1e\x01\xe7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x58\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x01\x0a\x01\xea\x00\xe9\x00\x1a\x01\x00\x00\xf0\x05\x00\x00\x50\x00\x07\x00\x00\x00\x00\x00\x00\x00\xa0\x00\x0f\x01\xfd\x00\xec\x00\xed\x00\xeb\x00\x00\x00\xbe\x00\xd7\x00\x00\x00\xad\x00\x27\x00\x75\x00\x27\x00\x00\x00\xd7\xff\x27\x00\x00\x00\x92\x00\x92\x00\x00\x00\x00\x00\x00\x00\x27\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\xd9\x00\x0f\x00\xdd\x00\x1b\x00\xd8\x00\xac\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa8\x00\x00\x00\x00\x00\x00\x00\x7f\x00\xfd\xff\x00\x00\x00\x00\x00\x00\xc1\x00\x27\x00\xc1\x00\xa3\x00\x00\x00\xa5\x00\xc6\x00\xc7\x00\x95\x00\x00\x00\xd0\x00\x78\x00\x00\x00\xf0\x05\x94\x00\x18\x00\x00\x00\x93\x00\x8b\x00\xfd\xff\xfd\xff\xfd\xff\xfd\xff\xfd\xff\xfd\xff\xfd\xff\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\xad\x00\xad\x00\xad\x00\xad\x00\xad\x00\xad\x00\xad\x00\xa2\x00\x92\x00\x92\x00\x92\x00\x92\x00\x92\x00\xb0\x00\x8e\x00\x8d\x00\xc3\x00\x00\x00\xad\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x07\x00\x00\x00\x00\x00\x00\x00\xb5\x00\xfd\xff\xb5\x00\xb7\x00\xa4\x00\xa6\x00\x85\x00\x00\x00\x7d\x00\x75\x00\x00\x00\x00\x00\x00\x00\x77\x00\xfd\xff\x6d\x00\x75\x00\x27\x00\x64\x00\x1b\x00\xfd\xff\xfd\xff\x00\x00\x62\x00\x00\x00\x00\x00\x00\x00\x6a\x01\x46\x00\x64\x00\x64\x00\xf3\xff\x51\x00\x00\x00\x00\x00\x64\x00\x75\x00\x00\x00\x75\x00\x78\x00\x00\x00\x00\x00\x00\x00\x31\x00\x3d\x00\x75\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+happyGotoOffsets :: HappyAddr
+happyGotoOffsets = HappyA# "\x1c\x00\x0c\x00\x70\x00\x65\x00\x68\x00\x00\x00\x00\x00\x00\x00\x33\x00\x00\x00\x00\x00\x00\x00\xf7\xff\x00\x00\xa1\x00\x00\x00\x00\x00\x82\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x69\x00\x35\x00\x00\x00\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3b\x02\xeb\xff\x3b\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8b\x04\x00\x00\x00\x00\xb3\x03\xc1\x05\x0c\x02\xa7\x05\x00\x00\x2a\x01\x91\x05\x00\x00\xc8\x02\x99\x02\x00\x00\x00\x00\x00\x00\x77\x05\x00\x00\x61\x05\x00\x00\x00\x00\x00\x00\xdd\x01\x00\x00\x0b\x00\x05\x00\x00\x00\x15\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\x00\x00\x00\x00\x00\x00\x00\x03\x00\x45\x06\x00\x00\x00\x00\x00\x00\x00\x00\x47\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x29\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x00\x00\x00\x00\x00\x00\x00\xfb\x00\x31\x06\x90\x06\x88\x06\xcf\x00\x7a\x06\x71\x06\x5b\x06\x17\x05\x01\x05\xe7\x04\xd1\x04\xa2\x04\x73\x04\x5b\x04\x43\x04\x2b\x04\x13\x04\xfb\x03\xe3\x03\x00\x00\x84\x03\x55\x03\x26\x03\xf7\x02\x6a\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2f\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\x01\x00\x00\x00\x00\x00\x00\x00\x00\x19\x06\x52\x00\x7f\x01\x31\x05\x00\x00\x0a\x00\x03\x06\xed\x05\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xff\xde\x01\x76\x00\x00\x00\x00\x00\x54\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x01\x00\x00\x21\x01\x00\x00\x00\x00\x00\x00\x00\x00\xd7\x05\xfb\xff\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+happyDefActions :: HappyAddr
+happyDefActions = HappyA# "\x84\xff\xef\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xff\x00\x00\x7e\xff\x00\x00\x00\x00\x00\x00\x7e\xff\x00\x00\xdd\xff\xee\xff\x00\x00\xef\xff\x83\xff\xeb\xff\xe9\xff\xe7\xff\xe8\xff\xf4\xff\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xff\xda\xff\xd9\xff\xdb\xff\xdc\xff\x00\x00\x7e\xff\x00\x00\xa1\xff\xa0\xff\x9f\xff\x86\xff\x8f\xff\x7d\xff\xc9\xff\xc5\xff\xc3\xff\xc1\xff\xbf\xff\xbd\xff\xbb\xff\xb2\xff\xb0\xff\xad\xff\xa9\xff\xa4\xff\xa2\xff\x9e\xff\x9a\xff\x98\xff\x96\xff\x94\xff\x92\xff\x90\xff\x00\x00\x7a\xff\xce\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\x00\x00\x00\x00\x8a\xff\x00\x00\x00\x00\x8c\xff\x8b\xff\x89\xff\x00\x00\x88\xff\x00\x00\xf9\xff\xf8\xff\xf7\xff\x00\x00\xf2\xff\xe6\xff\x00\x00\x00\x00\xd7\xff\xd3\xff\xed\xff\xd2\xff\xd4\xff\xd5\xff\xd6\xff\x00\x00\xcf\xff\xd1\xff\xd0\xff\xe4\xff\x00\x00\xf1\xff\xa8\xff\xa7\xff\xc7\xff\x00\x00\xc8\xff\x00\x00\x85\xff\x00\x00\x7c\xff\x00\x00\x00\x00\xa5\xff\x00\x00\x9e\xff\xa6\xff\xbc\xff\x00\x00\x86\xff\xb1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\xff\xc4\xff\xc2\xff\xc0\xff\xbe\xff\x00\x00\xb4\xff\xb6\xff\xb9\xff\xb8\xff\xb7\xff\xba\xff\xb5\xff\xae\xff\xaf\xff\xab\xff\xac\xff\xaa\xff\x9b\xff\x00\x00\x9c\xff\x99\xff\x97\xff\x95\xff\x93\xff\x91\xff\x00\x00\x00\x00\x79\xff\x8e\xff\x9d\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe5\xff\xd7\xff\x00\x00\x00\x00\x87\xff\x82\xff\xf5\xff\xea\xff\x80\xff\xef\xff\x00\x00\xe2\xff\xe3\xff\xe1\xff\x00\x00\xcc\xff\x7b\xff\x8d\xff\x00\x00\xca\xff\x00\x00\x00\x00\xb3\xff\xcb\xff\xcd\xff\x00\x00\xed\xff\x00\x00\xde\xff\xdf\xff\x81\xff\x7f\xff\xec\xff\xe0\xff\xf3\xff\xa3\xff"#
+
+happyCheck :: HappyAddr
+happyCheck = HappyA# "\xff\xff\x2a\x00\x01\x00\x06\x00\x03\x00\x00\x00\x0b\x00\x06\x00\x15\x00\x03\x00\x00\x00\x04\x00\x06\x00\x32\x00\x0d\x00\x08\x00\x1d\x00\x0e\x00\x06\x00\x0d\x00\x0b\x00\x00\x00\x0a\x00\x08\x00\x0d\x00\x14\x00\x13\x00\x44\x00\x12\x00\x13\x00\x33\x00\x01\x00\x04\x00\x03\x00\x03\x00\x08\x00\x06\x00\x0a\x00\x25\x00\x12\x00\x13\x00\x28\x00\x33\x00\x0d\x00\x14\x00\x06\x00\x2d\x00\x17\x00\x2f\x00\x30\x00\x31\x00\x2d\x00\x33\x00\x34\x00\x35\x00\x06\x00\x03\x00\x38\x00\x39\x00\x3a\x00\x03\x00\x22\x00\x38\x00\x21\x00\x3a\x00\x44\x00\x41\x00\x42\x00\x43\x00\x44\x00\x28\x00\x41\x00\x42\x00\x43\x00\x44\x00\x2d\x00\x30\x00\x2f\x00\x30\x00\x31\x00\x41\x00\x33\x00\x34\x00\x35\x00\x2d\x00\x03\x00\x38\x00\x39\x00\x3a\x00\x01\x00\x0a\x00\x03\x00\x41\x00\x0d\x00\x06\x00\x41\x00\x42\x00\x43\x00\x44\x00\x0f\x00\x10\x00\x0d\x00\x33\x00\x2e\x00\x41\x00\x42\x00\x43\x00\x44\x00\x03\x00\x08\x00\x35\x00\x0b\x00\x0c\x00\x09\x00\x41\x00\x42\x00\x43\x00\x44\x00\x01\x00\x07\x00\x03\x00\x03\x00\x3d\x00\x06\x00\x2b\x00\x25\x00\x15\x00\x07\x00\x28\x00\x2f\x00\x0d\x00\x0b\x00\x0c\x00\x2d\x00\x34\x00\x2f\x00\x30\x00\x31\x00\x44\x00\x33\x00\x34\x00\x35\x00\x0f\x00\x10\x00\x38\x00\x39\x00\x3a\x00\x01\x00\x03\x00\x03\x00\x11\x00\x2e\x00\x06\x00\x41\x00\x42\x00\x43\x00\x44\x00\x28\x00\x35\x00\x0d\x00\x3e\x00\x00\x00\x2d\x00\x2d\x00\x2f\x00\x30\x00\x31\x00\x31\x00\x33\x00\x34\x00\x35\x00\x0b\x00\x0c\x00\x38\x00\x39\x00\x3a\x00\x03\x00\x44\x00\x11\x00\x06\x00\x13\x00\x3e\x00\x41\x00\x42\x00\x43\x00\x44\x00\x0d\x00\x3e\x00\x16\x00\x19\x00\x2d\x00\x2d\x00\x09\x00\x2f\x00\x31\x00\x0e\x00\x06\x00\x33\x00\x34\x00\x35\x00\x05\x00\x3c\x00\x38\x00\x39\x00\x3a\x00\x3f\x00\x1e\x00\x44\x00\x2e\x00\x3e\x00\x03\x00\x41\x00\x42\x00\x43\x00\x44\x00\x07\x00\x44\x00\x44\x00\x2d\x00\x14\x00\x2f\x00\x17\x00\x3b\x00\x1e\x00\x33\x00\x34\x00\x35\x00\x3e\x00\x15\x00\x38\x00\x39\x00\x3a\x00\x2a\x00\x3d\x00\x12\x00\x2d\x00\x44\x00\x14\x00\x41\x00\x42\x00\x43\x00\x44\x00\x00\x00\x01\x00\x02\x00\x03\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x1d\x00\x24\x00\x11\x00\x2e\x00\x03\x00\x41\x00\x42\x00\x43\x00\x44\x00\x16\x00\x35\x00\x19\x00\x09\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x0e\x00\x2c\x00\x05\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x3c\x00\x2b\x00\x35\x00\x1e\x00\x3f\x00\x2f\x00\x44\x00\x03\x00\x03\x00\x1c\x00\x34\x00\x12\x00\x23\x00\x44\x00\x1a\x00\x45\x00\x45\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x41\x00\x2c\x00\x29\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x2b\x00\x2b\x00\x35\x00\x23\x00\x2f\x00\x2f\x00\x27\x00\xff\xff\xff\xff\x34\x00\x34\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x1a\x00\x35\x00\xff\xff\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x23\x00\x0c\x00\xff\xff\x26\x00\x27\x00\xff\xff\x29\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x40\x00\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x32\x00\xff\xff\x35\x00\xff\xff\x36\x00\x37\x00\xff\xff\xff\xff\xff\xff\xff\xff\x3c\x00\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\xff\xff\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\xff\xff\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x1a\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x23\x00\xff\xff\xff\xff\x26\x00\x27\x00\xff\xff\x29\x00\xff\xff\x15\x00\x2c\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\x45\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x15\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\xff\xff\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\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\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x02\x00\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x18\x00\xff\xff\xff\xff\x1b\x00\x35\x00\x1d\x00\xff\xff\x1f\x00\x20\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x2e\x00\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\x34\x00\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\x15\x00\x2e\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\x2a\x00\xff\xff\x2e\x00\x03\x00\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\x35\x00\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\x03\x00\xff\xff\xff\xff\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\x15\x00\x35\x00\xff\xff\xff\xff\x03\x00\xff\xff\xff\xff\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x15\x00\xff\xff\x2e\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\x35\x00\xff\xff\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\xff\xff\xff\xff\x29\x00\x2a\x00\xff\xff\xff\xff\x35\x00\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\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"#
+
+happyTable :: HappyAddr
+happyTable = HappyA# "\x00\x00\x72\x00\x42\x00\xa9\x00\x43\x00\x61\x00\xdb\x00\x44\x00\xd6\x00\x43\x00\x5a\x00\x84\x00\x44\x00\xc2\x00\x45\x00\x85\x00\xd7\x00\xba\x00\x0d\x00\x45\x00\xc0\x00\x5a\x00\x0e\x00\x64\x00\x64\x00\x62\x00\x86\x00\x54\x00\xc6\x00\x5c\x00\x54\x00\x42\x00\x10\x00\x43\x00\x56\x00\x5e\x00\x44\x00\x5f\x00\x67\x00\x5b\x00\x5c\x00\x47\x00\x21\x00\x45\x00\x85\xff\x44\x00\x48\x00\x85\xff\x49\x00\x4a\x00\x4b\x00\x48\x00\x4c\x00\x4d\x00\x4e\x00\x44\x00\x58\x00\x4f\x00\x50\x00\x51\x00\x27\x00\x60\x00\x4f\x00\x46\x00\x51\x00\x54\x00\x07\x00\x52\x00\x53\x00\x54\x00\x47\x00\x07\x00\x52\x00\x53\x00\x54\x00\x48\x00\x11\x00\x49\x00\x4a\x00\x4b\x00\x07\x00\x4c\x00\x4d\x00\x4e\x00\x48\x00\x6d\x00\x4f\x00\x50\x00\x51\x00\x42\x00\x87\x00\x43\x00\x07\x00\x88\x00\x44\x00\x07\x00\x52\x00\x53\x00\x54\x00\xd3\x00\xd4\x00\x45\x00\x23\x00\x3f\x00\x07\x00\x52\x00\x53\x00\x54\x00\x27\x00\x09\x00\xb1\x00\x82\x00\x83\x00\x07\x00\x07\x00\x52\x00\x53\x00\x54\x00\x42\x00\x0b\x00\x43\x00\xbd\x00\xc2\x00\x44\x00\xd3\x00\x56\x00\x59\x00\xb3\x00\x47\x00\x6f\x00\x45\x00\x82\x00\x83\x00\x48\x00\xc9\x00\x49\x00\x4a\x00\x4b\x00\x54\x00\x4c\x00\x4d\x00\x4e\x00\xbc\x00\xbd\x00\x4f\x00\x50\x00\x51\x00\x42\x00\xbd\x00\x43\x00\x7d\x00\x3f\x00\x44\x00\x07\x00\x52\x00\x53\x00\x54\x00\x47\x00\x40\x00\x45\x00\xc4\x00\x1a\x00\x48\x00\xbe\x00\x49\x00\x4a\x00\x4b\x00\xd7\x00\x4c\x00\x4d\x00\x4e\x00\x82\x00\x83\x00\x4f\x00\x50\x00\x51\x00\x43\x00\x54\x00\x1b\x00\x44\x00\x1c\x00\xcc\x00\x07\x00\x52\x00\x53\x00\x54\x00\x45\x00\xce\x00\x7e\x00\x7f\x00\xbe\x00\x48\x00\x80\x00\x49\x00\xbf\x00\x81\x00\x44\x00\x4c\x00\x4d\x00\x4e\x00\x91\x00\x92\x00\x4f\x00\x50\x00\x51\x00\x93\x00\x94\x00\x54\x00\x9b\x00\xb1\x00\x27\x00\x07\x00\x52\x00\x53\x00\x54\x00\xb4\x00\x54\x00\x54\x00\x48\x00\xb6\x00\x49\x00\xb7\x00\xb9\x00\x94\x00\x4c\x00\x4d\x00\x4e\x00\xb8\x00\x28\x00\x4f\x00\x50\x00\x51\x00\x7c\x00\xc2\x00\x58\x00\x48\x00\x54\x00\x66\x00\x07\x00\x52\x00\x53\x00\x54\x00\x24\x00\x25\x00\x26\x00\x27\x00\xab\x00\x3b\x00\x3c\x00\x3d\x00\x61\x00\x78\x00\x7d\x00\x3f\x00\x6d\x00\x07\x00\x52\x00\x53\x00\x54\x00\x7e\x00\x40\x00\x7f\x00\x80\x00\x28\x00\xda\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\x81\x00\x3e\x00\x91\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x92\x00\xaf\x00\x40\x00\x94\x00\x93\x00\x6f\x00\x54\x00\x6d\x00\x6d\x00\x95\x00\x70\x00\x58\x00\x23\x00\x54\x00\x09\x00\xff\xff\xff\xff\x28\x00\xd0\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\x07\x00\x3e\x00\x0b\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\xb4\x00\x6e\x00\x40\x00\x0d\x00\x6f\x00\x6f\x00\x10\x00\x00\x00\x00\x00\x70\x00\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\xd1\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x09\x00\x40\x00\x00\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x0e\x00\x0d\x00\x17\x00\x00\x00\x19\x00\x10\x00\x00\x00\x0b\x00\x28\x00\xc8\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\xda\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x1e\x00\x00\x00\x40\x00\x00\x00\x1f\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x28\x00\xcc\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x13\x00\x14\x00\x15\x00\x16\x00\x0e\x00\x00\x00\xd8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x73\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\x74\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x95\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x69\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x6b\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x96\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x97\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x98\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\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\x00\x00\x6a\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x09\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x19\x00\x10\x00\x00\x00\x0b\x00\x00\x00\x28\x00\x1a\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x76\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\x00\x00\x6a\x00\x28\x00\x3f\x00\xf6\xff\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\xcf\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9b\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9c\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9d\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9e\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9f\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\xa0\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x78\x00\x00\x00\x40\x00\xa1\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\x00\x00\x6a\x00\x28\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x79\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x7a\x00\x28\x00\x00\x00\x3f\x00\x6f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x70\x00\x40\x00\x00\x00\xa2\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa3\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\xa4\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\xa6\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc7\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x79\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x67\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x68\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6c\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x72\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x75\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x89\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\xdc\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x8a\x00\x00\x00\x00\x00\x8b\x00\x40\x00\x8c\x00\x00\x00\x8d\x00\x8e\x00\xc4\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x8f\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x90\x00\x00\x00\x00\x00\xc5\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x28\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\xae\x00\x00\x00\x3f\x00\x27\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\x00\x00\xb9\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\xa7\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x28\x00\x40\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\xa9\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x28\x00\x00\x00\x3f\x00\xaa\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x40\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\xac\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x00\x00\xad\x00\x3d\x00\x00\x00\x00\x00\x40\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
+
+happyReduceArr = Happy_Data_Array.array (5, 134) [
+	(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)
+	]
+
+happy_n_terms = 70 :: Int
+happy_n_nonterms = 54 :: Int
+
+happyReduce_5 = happySpecReduce_1  0# happyReduction_5
+happyReduction_5 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn8
+		 (PosInteger (mkPosToken happy_var_1)
+	)}
+
+happyReduce_6 = happySpecReduce_1  1# happyReduction_6
+happyReduction_6 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn9
+		 (PosDouble (mkPosToken happy_var_1)
+	)}
+
+happyReduce_7 = happySpecReduce_1  2# happyReduction_7
+happyReduction_7 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn10
+		 (PosString (mkPosToken happy_var_1)
+	)}
+
+happyReduce_8 = happySpecReduce_1  3# happyReduction_8
+happyReduction_8 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn11
+		 (PosIdent (mkPosToken happy_var_1)
+	)}
+
+happyReduce_9 = happySpecReduce_1  4# happyReduction_9
+happyReduction_9 happy_x_1
+	 =  case happyOut56 happy_x_1 of { happy_var_1 -> 
+	happyIn12
+		 (Module ((mkCatSpan happy_var_1)) (reverse happy_var_1)
+	)}
+
+happyReduce_10 = happyReduce 4# 5# happyReduction_10
+happyReduction_10 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut11 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	case happyOut57 happy_x_4 of { happy_var_4 -> 
+	happyIn13
+		 (EnumDecl ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_11 = happySpecReduce_1  5# happyReduction_11
+happyReduction_11 happy_x_1
+	 =  case happyOut20 happy_x_1 of { happy_var_1 -> 
+	happyIn13
+		 (ElementDecl ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_12 = happyReduce 8# 6# happyReduction_12
+happyReduction_12 (happy_x_8 `HappyStk`
+	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 happyOut18 happy_x_1 of { happy_var_1 -> 
+	case happyOut25 happy_x_2 of { happy_var_2 -> 
+	case happyOut11 happy_x_3 of { happy_var_3 -> 
+	case happyOut21 happy_x_4 of { happy_var_4 -> 
+	case happyOut22 happy_x_5 of { happy_var_5 -> 
+	case happyOut26 happy_x_6 of { happy_var_6 -> 
+	case happyOut23 happy_x_7 of { happy_var_7 -> 
+	case happyOut19 happy_x_8 of { happy_var_8 -> 
+	happyIn14
+		 (Clafer ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkCatSpan happy_var_4) >- (mkCatSpan happy_var_5) >- (mkCatSpan happy_var_6) >- (mkCatSpan happy_var_7) >- (mkCatSpan happy_var_8)) happy_var_1 happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6 happy_var_7 happy_var_8
+	) `HappyStk` happyRest}}}}}}}}
+
+happyReduce_13 = happySpecReduce_3  7# happyReduction_13
+happyReduction_13 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut59 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	happyIn15
+		 (Constraint ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
+	)}}}
+
+happyReduce_14 = happyReduce 4# 8# happyReduction_14
+happyReduction_14 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut59 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { happy_var_4 -> 
+	happyIn16
+		 (SoftConstraint ((mkTokenSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4)) (reverse happy_var_3)
+	) `HappyStk` happyRest}}}}
+
+happyReduce_15 = happySpecReduce_3  9# happyReduction_15
+happyReduction_15 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut59 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	happyIn17
+		 (Goal ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
+	)}}}
+
+happyReduce_16 = happySpecReduce_0  10# happyReduction_16
+happyReduction_16  =  happyIn18
+		 (AbstractEmpty noSpan
+	)
+
+happyReduce_17 = happySpecReduce_1  10# happyReduction_17
+happyReduction_17 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn18
+		 (Abstract ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_18 = happySpecReduce_0  11# happyReduction_18
+happyReduction_18  =  happyIn19
+		 (ElementsEmpty noSpan
+	)
+
+happyReduce_19 = happySpecReduce_3  11# happyReduction_19
+happyReduction_19 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut58 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	happyIn19
+		 (ElementsList ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
+	)}}}
+
+happyReduce_20 = happySpecReduce_1  12# happyReduction_20
+happyReduction_20 happy_x_1
+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> 
+	happyIn20
+		 (Subclafer ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_21 = happyReduce 4# 12# happyReduction_21
+happyReduction_21 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut29 happy_x_2 of { happy_var_2 -> 
+	case happyOut26 happy_x_3 of { happy_var_3 -> 
+	case happyOut19 happy_x_4 of { happy_var_4 -> 
+	happyIn20
+		 (ClaferUse ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_22 = happySpecReduce_1  12# happyReduction_22
+happyReduction_22 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn20
+		 (Subconstraint ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_23 = happySpecReduce_1  12# happyReduction_23
+happyReduction_23 happy_x_1
+	 =  case happyOut17 happy_x_1 of { happy_var_1 -> 
+	happyIn20
+		 (Subgoal ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_24 = happySpecReduce_1  12# happyReduction_24
+happyReduction_24 happy_x_1
+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> 
+	happyIn20
+		 (Subsoftconstraint ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_25 = happySpecReduce_0  13# happyReduction_25
+happyReduction_25  =  happyIn21
+		 (SuperEmpty noSpan
+	)
+
+happyReduce_26 = happySpecReduce_2  13# happyReduction_26
+happyReduction_26 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn21
+		 (SuperSome ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_27 = happySpecReduce_0  14# happyReduction_27
+happyReduction_27  =  happyIn22
+		 (ReferenceEmpty noSpan
+	)
+
+happyReduce_28 = happySpecReduce_2  14# happyReduction_28
+happyReduction_28 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn22
+		 (ReferenceSet ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_29 = happySpecReduce_2  14# happyReduction_29
+happyReduction_29 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn22
+		 (ReferenceBag ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_30 = happySpecReduce_0  15# happyReduction_30
+happyReduction_30  =  happyIn23
+		 (InitEmpty noSpan
+	)
+
+happyReduce_31 = happySpecReduce_2  15# happyReduction_31
+happyReduction_31 happy_x_2
+	happy_x_1
+	 =  case happyOut24 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn23
+		 (InitSome ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_32 = happySpecReduce_1  16# happyReduction_32
+happyReduction_32 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn24
+		 (InitConstant ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_33 = happySpecReduce_1  16# happyReduction_33
+happyReduction_33 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn24
+		 (InitDefault ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_34 = happySpecReduce_0  17# happyReduction_34
+happyReduction_34  =  happyIn25
+		 (GCardEmpty noSpan
+	)
+
+happyReduce_35 = happySpecReduce_1  17# happyReduction_35
+happyReduction_35 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (GCardXor ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_36 = happySpecReduce_1  17# happyReduction_36
+happyReduction_36 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (GCardOr ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_37 = happySpecReduce_1  17# happyReduction_37
+happyReduction_37 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (GCardMux ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_38 = happySpecReduce_1  17# happyReduction_38
+happyReduction_38 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (GCardOpt ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_39 = happySpecReduce_1  17# happyReduction_39
+happyReduction_39 happy_x_1
+	 =  case happyOut27 happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (GCardInterval ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_40 = happySpecReduce_0  18# happyReduction_40
+happyReduction_40  =  happyIn26
+		 (CardEmpty noSpan
+	)
+
+happyReduce_41 = happySpecReduce_1  18# happyReduction_41
+happyReduction_41 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn26
+		 (CardLone ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_42 = happySpecReduce_1  18# happyReduction_42
+happyReduction_42 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn26
+		 (CardSome ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_43 = happySpecReduce_1  18# happyReduction_43
+happyReduction_43 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn26
+		 (CardAny ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_44 = happySpecReduce_1  18# happyReduction_44
+happyReduction_44 happy_x_1
+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
+	happyIn26
+		 (CardNum ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_45 = happySpecReduce_1  18# happyReduction_45
+happyReduction_45 happy_x_1
+	 =  case happyOut27 happy_x_1 of { happy_var_1 -> 
+	happyIn26
+		 (CardInterval ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_46 = happySpecReduce_3  19# happyReduction_46
+happyReduction_46 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut28 happy_x_3 of { happy_var_3 -> 
+	happyIn27
+		 (NCard ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_47 = happySpecReduce_1  20# happyReduction_47
+happyReduction_47 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn28
+		 (ExIntegerAst ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_48 = happySpecReduce_1  20# happyReduction_48
+happyReduction_48 happy_x_1
+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
+	happyIn28
+		 (ExIntegerNum ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_49 = happySpecReduce_1  21# happyReduction_49
+happyReduction_49 happy_x_1
+	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
+	happyIn29
+		 (Path ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_50 = happyReduce 5# 22# happyReduction_50
+happyReduction_50 (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 { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut51 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { happy_var_4 -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	happyIn30
+		 (DeclAllDisj ((mkTokenSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4) >- (mkCatSpan happy_var_5)) happy_var_3 happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_51 = happyReduce 4# 22# happyReduction_51
+happyReduction_51 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut51 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	case happyOut30 happy_x_4 of { happy_var_4 -> 
+	happyIn30
+		 (DeclAll ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_52 = happyReduce 5# 22# happyReduction_52
+happyReduction_52 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut51 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { happy_var_4 -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	happyIn30
+		 (DeclQuantDisj ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4) >- (mkCatSpan happy_var_5)) happy_var_1 happy_var_3 happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_53 = happyReduce 4# 22# happyReduction_53
+happyReduction_53 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOut51 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	case happyOut30 happy_x_4 of { happy_var_4 -> 
+	happyIn30
+		 (DeclQuant ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_1 happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_54 = happySpecReduce_1  22# happyReduction_54
+happyReduction_54 happy_x_1
+	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
+	happyIn30
+		 (happy_var_1
+	)}
+
+happyReduce_55 = happySpecReduce_2  23# happyReduction_55
+happyReduction_55 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut32 happy_x_2 of { happy_var_2 -> 
+	happyIn31
+		 (EGMax ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_56 = happySpecReduce_2  23# happyReduction_56
+happyReduction_56 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut32 happy_x_2 of { happy_var_2 -> 
+	happyIn31
+		 (EGMin ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_57 = happySpecReduce_3  23# happyReduction_57
+happyReduction_57 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut32 happy_x_3 of { happy_var_3 -> 
+	happyIn31
+		 (EIff ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_58 = happySpecReduce_1  23# happyReduction_58
+happyReduction_58 happy_x_1
+	 =  case happyOut32 happy_x_1 of { happy_var_1 -> 
+	happyIn31
+		 (happy_var_1
+	)}
+
+happyReduce_59 = happySpecReduce_3  24# happyReduction_59
+happyReduction_59 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut32 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut33 happy_x_3 of { happy_var_3 -> 
+	happyIn32
+		 (EImplies ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_60 = happySpecReduce_1  24# happyReduction_60
+happyReduction_60 happy_x_1
+	 =  case happyOut33 happy_x_1 of { happy_var_1 -> 
+	happyIn32
+		 (happy_var_1
+	)}
+
+happyReduce_61 = happySpecReduce_3  25# happyReduction_61
+happyReduction_61 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut33 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut34 happy_x_3 of { happy_var_3 -> 
+	happyIn33
+		 (EOr ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_62 = happySpecReduce_1  25# happyReduction_62
+happyReduction_62 happy_x_1
+	 =  case happyOut34 happy_x_1 of { happy_var_1 -> 
+	happyIn33
+		 (happy_var_1
+	)}
+
+happyReduce_63 = happySpecReduce_3  26# happyReduction_63
+happyReduction_63 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut34 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut35 happy_x_3 of { happy_var_3 -> 
+	happyIn34
+		 (EXor ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_64 = happySpecReduce_1  26# happyReduction_64
+happyReduction_64 happy_x_1
+	 =  case happyOut35 happy_x_1 of { happy_var_1 -> 
+	happyIn34
+		 (happy_var_1
+	)}
+
+happyReduce_65 = happySpecReduce_3  27# happyReduction_65
+happyReduction_65 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut35 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut36 happy_x_3 of { happy_var_3 -> 
+	happyIn35
+		 (EAnd ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_66 = happySpecReduce_1  27# happyReduction_66
+happyReduction_66 happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	happyIn35
+		 (happy_var_1
+	)}
+
+happyReduce_67 = happySpecReduce_2  28# happyReduction_67
+happyReduction_67 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut37 happy_x_2 of { happy_var_2 -> 
+	happyIn36
+		 (ENeg ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_68 = happySpecReduce_1  28# happyReduction_68
+happyReduction_68 happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	happyIn36
+		 (happy_var_1
+	)}
+
+happyReduce_69 = happySpecReduce_3  29# happyReduction_69
+happyReduction_69 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (ELt ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_70 = happySpecReduce_3  29# happyReduction_70
+happyReduction_70 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (EGt ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_71 = happySpecReduce_3  29# happyReduction_71
+happyReduction_71 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (EEq ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_72 = happySpecReduce_3  29# happyReduction_72
+happyReduction_72 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (ELte ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_73 = happySpecReduce_3  29# happyReduction_73
+happyReduction_73 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (EGte ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_74 = happySpecReduce_3  29# happyReduction_74
+happyReduction_74 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (ENeq ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_75 = happySpecReduce_3  29# happyReduction_75
+happyReduction_75 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut38 happy_x_3 of { happy_var_3 -> 
+	happyIn37
+		 (EIn ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_76 = happyReduce 4# 29# happyReduction_76
+happyReduction_76 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut37 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	case happyOut38 happy_x_4 of { happy_var_4 -> 
+	happyIn37
+		 (ENin ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_1 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_77 = happySpecReduce_1  29# happyReduction_77
+happyReduction_77 happy_x_1
+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
+	happyIn37
+		 (happy_var_1
+	)}
+
+happyReduce_78 = happySpecReduce_2  30# happyReduction_78
+happyReduction_78 happy_x_2
+	happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	happyIn38
+		 (QuantExp ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_1 happy_var_2
+	)}}
+
+happyReduce_79 = happySpecReduce_1  30# happyReduction_79
+happyReduction_79 happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	happyIn38
+		 (happy_var_1
+	)}
+
+happyReduce_80 = happySpecReduce_3  31# happyReduction_80
+happyReduction_80 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut40 happy_x_3 of { happy_var_3 -> 
+	happyIn39
+		 (EAdd ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_81 = happySpecReduce_3  31# happyReduction_81
+happyReduction_81 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut40 happy_x_3 of { happy_var_3 -> 
+	happyIn39
+		 (ESub ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_82 = happySpecReduce_1  31# happyReduction_82
+happyReduction_82 happy_x_1
+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
+	happyIn39
+		 (happy_var_1
+	)}
+
+happyReduce_83 = happySpecReduce_3  32# happyReduction_83
+happyReduction_83 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut41 happy_x_3 of { happy_var_3 -> 
+	happyIn40
+		 (EMul ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_84 = happySpecReduce_3  32# happyReduction_84
+happyReduction_84 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut41 happy_x_3 of { happy_var_3 -> 
+	happyIn40
+		 (EDiv ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_85 = happySpecReduce_3  32# happyReduction_85
+happyReduction_85 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut41 happy_x_3 of { happy_var_3 -> 
+	happyIn40
+		 (ERem ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_86 = happySpecReduce_1  32# happyReduction_86
+happyReduction_86 happy_x_1
+	 =  case happyOut41 happy_x_1 of { happy_var_1 -> 
+	happyIn40
+		 (happy_var_1
+	)}
+
+happyReduce_87 = happySpecReduce_2  33# happyReduction_87
+happyReduction_87 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	happyIn41
+		 (ESumSetExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_88 = happySpecReduce_2  33# happyReduction_88
+happyReduction_88 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	happyIn41
+		 (EProdSetExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_89 = happySpecReduce_2  33# happyReduction_89
+happyReduction_89 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	happyIn41
+		 (ECSetExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_90 = happySpecReduce_2  33# happyReduction_90
+happyReduction_90 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	happyIn41
+		 (EMinExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
+	)}}
+
+happyReduce_91 = happySpecReduce_1  33# happyReduction_91
+happyReduction_91 happy_x_1
+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
+	happyIn41
+		 (happy_var_1
+	)}
+
+happyReduce_92 = happyReduce 6# 34# happyReduction_92
+happyReduction_92 (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 { happy_var_1 -> 
+	case happyOut42 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { happy_var_3 -> 
+	case happyOut42 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { happy_var_5 -> 
+	case happyOut43 happy_x_6 of { happy_var_6 -> 
+	happyIn42
+		 (EImpliesElse ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4) >- (mkTokenSpan happy_var_5) >- (mkCatSpan happy_var_6)) happy_var_2 happy_var_4 happy_var_6
+	) `HappyStk` happyRest}}}}}}
+
+happyReduce_93 = happySpecReduce_1  34# happyReduction_93
+happyReduction_93 happy_x_1
+	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
+	happyIn42
+		 (happy_var_1
+	)}
+
+happyReduce_94 = happySpecReduce_1  35# happyReduction_94
+happyReduction_94 happy_x_1
+	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 (EInt ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_95 = happySpecReduce_1  35# happyReduction_95
+happyReduction_95 happy_x_1
+	 =  case happyOut9 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 (EDouble ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_96 = happySpecReduce_1  35# happyReduction_96
+happyReduction_96 happy_x_1
+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 (EStr ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_97 = happySpecReduce_1  35# happyReduction_97
+happyReduction_97 happy_x_1
+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 (ESetExp ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_98 = happySpecReduce_3  35# happyReduction_98
+happyReduction_98 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn43
+		 (happy_var_2
+	)}
+
+happyReduce_99 = happySpecReduce_3  36# happyReduction_99
+happyReduction_99 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut45 happy_x_3 of { happy_var_3 -> 
+	happyIn44
+		 (Union ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_100 = happySpecReduce_3  36# happyReduction_100
+happyReduction_100 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut45 happy_x_3 of { happy_var_3 -> 
+	happyIn44
+		 (UnionCom ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_101 = happySpecReduce_1  36# happyReduction_101
+happyReduction_101 happy_x_1
+	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
+	happyIn44
+		 (happy_var_1
+	)}
+
+happyReduce_102 = happySpecReduce_3  37# happyReduction_102
+happyReduction_102 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut46 happy_x_3 of { happy_var_3 -> 
+	happyIn45
+		 (Difference ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_103 = happySpecReduce_1  37# happyReduction_103
+happyReduction_103 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn45
+		 (happy_var_1
+	)}
+
+happyReduce_104 = happySpecReduce_3  38# happyReduction_104
+happyReduction_104 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	happyIn46
+		 (Intersection ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_105 = happySpecReduce_1  38# happyReduction_105
+happyReduction_105 happy_x_1
+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
+	happyIn46
+		 (happy_var_1
+	)}
+
+happyReduce_106 = happySpecReduce_3  39# happyReduction_106
+happyReduction_106 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut48 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (Domain ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_107 = happySpecReduce_1  39# happyReduction_107
+happyReduction_107 happy_x_1
+	 =  case happyOut48 happy_x_1 of { happy_var_1 -> 
+	happyIn47
+		 (happy_var_1
+	)}
+
+happyReduce_108 = happySpecReduce_3  40# happyReduction_108
+happyReduction_108 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut48 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut49 happy_x_3 of { happy_var_3 -> 
+	happyIn48
+		 (Range ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_109 = happySpecReduce_1  40# happyReduction_109
+happyReduction_109 happy_x_1
+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
+	happyIn48
+		 (happy_var_1
+	)}
+
+happyReduce_110 = happySpecReduce_3  41# happyReduction_110
+happyReduction_110 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut50 happy_x_3 of { happy_var_3 -> 
+	happyIn49
+		 (Join ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_111 = happySpecReduce_1  41# happyReduction_111
+happyReduction_111 happy_x_1
+	 =  case happyOut50 happy_x_1 of { happy_var_1 -> 
+	happyIn49
+		 (happy_var_1
+	)}
+
+happyReduce_112 = happySpecReduce_1  42# happyReduction_112
+happyReduction_112 happy_x_1
+	 =  case happyOut29 happy_x_1 of { happy_var_1 -> 
+	happyIn50
+		 (ClaferId ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_113 = happySpecReduce_3  42# happyReduction_113
+happyReduction_113 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_2 of { happy_var_2 -> 
+	happyIn50
+		 (happy_var_2
+	)}
+
+happyReduce_114 = happySpecReduce_3  43# happyReduction_114
+happyReduction_114 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { happy_var_2 -> 
+	case happyOut44 happy_x_3 of { happy_var_3 -> 
+	happyIn51
+		 (Decl ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_115 = happySpecReduce_1  44# happyReduction_115
+happyReduction_115 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (QuantNo ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_116 = happySpecReduce_1  44# happyReduction_116
+happyReduction_116 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (QuantNot ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_117 = happySpecReduce_1  44# happyReduction_117
+happyReduction_117 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (QuantLone ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_118 = happySpecReduce_1  44# happyReduction_118
+happyReduction_118 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (QuantOne ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_119 = happySpecReduce_1  44# happyReduction_119
+happyReduction_119 happy_x_1
+	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
+	happyIn52
+		 (QuantSome ((mkTokenSpan happy_var_1))
+	)}
+
+happyReduce_120 = happySpecReduce_1  45# happyReduction_120
+happyReduction_120 happy_x_1
+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
+	happyIn53
+		 (EnumIdIdent ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_121 = happySpecReduce_1  46# happyReduction_121
+happyReduction_121 happy_x_1
+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
+	happyIn54
+		 (ModIdIdent ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_122 = happySpecReduce_1  47# happyReduction_122
+happyReduction_122 happy_x_1
+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
+	happyIn55
+		 (LocIdIdent ((mkCatSpan happy_var_1)) happy_var_1
+	)}
+
+happyReduce_123 = happySpecReduce_0  48# happyReduction_123
+happyReduction_123  =  happyIn56
+		 ([]
+	)
+
+happyReduce_124 = happySpecReduce_2  48# happyReduction_124
+happyReduction_124 happy_x_2
+	happy_x_1
+	 =  case happyOut56 happy_x_1 of { happy_var_1 -> 
+	case happyOut13 happy_x_2 of { happy_var_2 -> 
+	happyIn56
+		 (flip (:)  happy_var_1 happy_var_2
+	)}}
+
+happyReduce_125 = happySpecReduce_1  49# happyReduction_125
+happyReduction_125 happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	happyIn57
+		 ((:[])  happy_var_1
+	)}
+
+happyReduce_126 = happySpecReduce_3  49# happyReduction_126
+happyReduction_126 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	case happyOut57 happy_x_3 of { happy_var_3 -> 
+	happyIn57
+		 ((:)  happy_var_1 happy_var_3
+	)}}
+
+happyReduce_127 = happySpecReduce_0  50# happyReduction_127
+happyReduction_127  =  happyIn58
+		 ([]
+	)
+
+happyReduce_128 = happySpecReduce_2  50# happyReduction_128
+happyReduction_128 happy_x_2
+	happy_x_1
+	 =  case happyOut58 happy_x_1 of { happy_var_1 -> 
+	case happyOut20 happy_x_2 of { happy_var_2 -> 
+	happyIn58
+		 (flip (:)  happy_var_1 happy_var_2
+	)}}
+
+happyReduce_129 = happySpecReduce_0  51# happyReduction_129
+happyReduction_129  =  happyIn59
+		 ([]
+	)
+
+happyReduce_130 = happySpecReduce_2  51# happyReduction_130
+happyReduction_130 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn59
+		 (flip (:)  happy_var_1 happy_var_2
+	)}}
+
+happyReduce_131 = happySpecReduce_1  52# happyReduction_131
+happyReduction_131 happy_x_1
+	 =  case happyOut55 happy_x_1 of { happy_var_1 -> 
+	happyIn60
+		 ((:[])  happy_var_1
+	)}
+
+happyReduce_132 = happySpecReduce_3  52# happyReduction_132
+happyReduction_132 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut55 happy_x_1 of { happy_var_1 -> 
+	case happyOut60 happy_x_3 of { happy_var_3 -> 
+	happyIn60
+		 ((:)  happy_var_1 happy_var_3
+	)}}
+
+happyReduce_133 = happySpecReduce_1  53# happyReduction_133
+happyReduction_133 happy_x_1
+	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
+	happyIn61
+		 ((:[])  happy_var_1
+	)}
+
+happyReduce_134 = happySpecReduce_3  53# happyReduction_134
+happyReduction_134 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
+	case happyOut61 happy_x_3 of { happy_var_3 -> 
+	happyIn61
+		 ((:)  happy_var_1 happy_var_3
+	)}}
+
+happyNewToken action sts stk [] =
+	happyDoAction 69# notHappyAtAll action sts stk []
+
+happyNewToken action sts stk (tk:tks) =
+	let cont i = happyDoAction i tk action sts stk tks in
+	case tk of {
+	PT _ (TS _ 1) -> cont 1#;
+	PT _ (TS _ 2) -> cont 2#;
+	PT _ (TS _ 3) -> cont 3#;
+	PT _ (TS _ 4) -> cont 4#;
+	PT _ (TS _ 5) -> cont 5#;
+	PT _ (TS _ 6) -> cont 6#;
+	PT _ (TS _ 7) -> cont 7#;
+	PT _ (TS _ 8) -> cont 8#;
+	PT _ (TS _ 9) -> cont 9#;
+	PT _ (TS _ 10) -> cont 10#;
+	PT _ (TS _ 11) -> cont 11#;
+	PT _ (TS _ 12) -> cont 12#;
+	PT _ (TS _ 13) -> cont 13#;
+	PT _ (TS _ 14) -> cont 14#;
+	PT _ (TS _ 15) -> cont 15#;
+	PT _ (TS _ 16) -> cont 16#;
+	PT _ (TS _ 17) -> cont 17#;
+	PT _ (TS _ 18) -> cont 18#;
+	PT _ (TS _ 19) -> cont 19#;
+	PT _ (TS _ 20) -> cont 20#;
+	PT _ (TS _ 21) -> cont 21#;
+	PT _ (TS _ 22) -> cont 22#;
+	PT _ (TS _ 23) -> cont 23#;
+	PT _ (TS _ 24) -> cont 24#;
+	PT _ (TS _ 25) -> cont 25#;
+	PT _ (TS _ 26) -> cont 26#;
+	PT _ (TS _ 27) -> cont 27#;
+	PT _ (TS _ 28) -> cont 28#;
+	PT _ (TS _ 29) -> cont 29#;
+	PT _ (TS _ 30) -> cont 30#;
+	PT _ (TS _ 31) -> cont 31#;
+	PT _ (TS _ 32) -> cont 32#;
+	PT _ (TS _ 33) -> cont 33#;
+	PT _ (TS _ 34) -> cont 34#;
+	PT _ (TS _ 35) -> cont 35#;
+	PT _ (TS _ 36) -> cont 36#;
+	PT _ (TS _ 37) -> cont 37#;
+	PT _ (TS _ 38) -> cont 38#;
+	PT _ (TS _ 39) -> cont 39#;
+	PT _ (TS _ 40) -> cont 40#;
+	PT _ (TS _ 41) -> cont 41#;
+	PT _ (TS _ 42) -> cont 42#;
+	PT _ (TS _ 43) -> cont 43#;
+	PT _ (TS _ 44) -> cont 44#;
+	PT _ (TS _ 45) -> cont 45#;
+	PT _ (TS _ 46) -> cont 46#;
+	PT _ (TS _ 47) -> cont 47#;
+	PT _ (TS _ 48) -> cont 48#;
+	PT _ (TS _ 49) -> cont 49#;
+	PT _ (TS _ 50) -> cont 50#;
+	PT _ (TS _ 51) -> cont 51#;
+	PT _ (TS _ 52) -> cont 52#;
+	PT _ (TS _ 53) -> cont 53#;
+	PT _ (TS _ 54) -> cont 54#;
+	PT _ (TS _ 55) -> cont 55#;
+	PT _ (TS _ 56) -> cont 56#;
+	PT _ (TS _ 57) -> cont 57#;
+	PT _ (TS _ 58) -> cont 58#;
+	PT _ (TS _ 59) -> cont 59#;
+	PT _ (TS _ 60) -> cont 60#;
+	PT _ (TS _ 61) -> cont 61#;
+	PT _ (TS _ 62) -> cont 62#;
+	PT _ (TS _ 63) -> cont 63#;
+	PT _ (TS _ 64) -> cont 64#;
+	PT _ (T_PosInteger _) -> cont 65#;
+	PT _ (T_PosDouble _) -> cont 66#;
+	PT _ (T_PosString _) -> cont 67#;
+	PT _ (T_PosIdent _) -> cont 68#;
+	_ -> happyError' (tk:tks)
+	}
+
+happyError_ 69# tk tks = happyError' tks
+happyError_ _ tk tks = happyError' (tk:tks)
+
+happyThen :: () => Err a -> (a -> Err b) -> Err b
+happyThen = (thenM)
+happyReturn :: () => a -> Err a
+happyReturn = (returnM)
+happyThen1 m k tks = (thenM) m (\a -> k a tks)
+happyReturn1 :: () => a -> b -> Err a
+happyReturn1 = \a tks -> (returnM) a
+happyError' :: () => [(Token)] -> Err a
+happyError' = happyError
+
+pModule tks = happySomeParser where
+  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut12 x))
+
+pClafer tks = happySomeParser where
+  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut14 x))
+
+pConstraint tks = happySomeParser where
+  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut15 x))
+
+pSoftConstraint tks = happySomeParser where
+  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut16 x))
+
+pGoal tks = happySomeParser where
+  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut17 x))
+
+happySeq = happyDontSeq
+
+
+returnM :: a -> Err a
+returnM = return
+
+thenM :: Err a -> (a -> Err b) -> Err b
+thenM = (>>=)
+
+happyError :: [Token] -> Err a
+happyError ts =
+  Bad (pp ts) $ "syntax error at " ++ tokenPos ts ++ 
+  case ts of
+    [] -> []
+    [Err _] -> " due to lexer error"
+    _ -> " before " ++ unwords (map (id . prToken) (take 4 ts))
+
+myLexer = tokens
+
+gp x@(PT (Pn _ l c) _) = Span (Pos (toInteger l) (toInteger c)) (Pos (toInteger l) (toInteger c + toInteger (length $ prToken x)))
+pp (PT (Pn _ l c) _ :_) = Pos (toInteger l) (toInteger c)
+pp (Err (Pn _ l c) :_) = Pos (toInteger l) (toInteger c)
+pp _ = error "EOF"
+
+mkCatSpan :: (Spannable c) => c -> Span
+mkCatSpan = getSpan
+
+mkTokenSpan :: Token -> Span
+mkTokenSpan = gp
+{-# 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/dist/build/Language/Clafer/Front/Parclafer.hs b/dist/build/Language/Clafer/Front/Parclafer.hs
deleted file mode 100644
--- a/dist/build/Language/Clafer/Front/Parclafer.hs
+++ /dev/null
@@ -1,2021 +0,0 @@
-{-# OPTIONS_GHC -w #-}
-{-# OPTIONS -fglasgow-exts -cpp #-}
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
-module Language.Clafer.Front.Parclafer where
-import Language.Clafer.Front.Absclafer
-import Language.Clafer.Front.Lexclafer
-import Language.Clafer.Front.ErrM
-import qualified Data.Array as Happy_Data_Array
-import qualified GHC.Exts as Happy_GHC_Exts
-import Control.Applicative(Applicative(..))
-
--- parser produced by Happy Version 1.19.4
-
-newtype HappyAbsSyn  = HappyAbsSyn HappyAny
-#if __GLASGOW_HASKELL__ >= 607
-type HappyAny = Happy_GHC_Exts.Any
-#else
-type HappyAny = forall a . a
-#endif
-happyIn8 :: (PosInteger) -> (HappyAbsSyn )
-happyIn8 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn8 #-}
-happyOut8 :: (HappyAbsSyn ) -> (PosInteger)
-happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut8 #-}
-happyIn9 :: (PosDouble) -> (HappyAbsSyn )
-happyIn9 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn9 #-}
-happyOut9 :: (HappyAbsSyn ) -> (PosDouble)
-happyOut9 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut9 #-}
-happyIn10 :: (PosString) -> (HappyAbsSyn )
-happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn10 #-}
-happyOut10 :: (HappyAbsSyn ) -> (PosString)
-happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut10 #-}
-happyIn11 :: (PosIdent) -> (HappyAbsSyn )
-happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn11 #-}
-happyOut11 :: (HappyAbsSyn ) -> (PosIdent)
-happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut11 #-}
-happyIn12 :: (Module) -> (HappyAbsSyn )
-happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn12 #-}
-happyOut12 :: (HappyAbsSyn ) -> (Module)
-happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut12 #-}
-happyIn13 :: (Declaration) -> (HappyAbsSyn )
-happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn13 #-}
-happyOut13 :: (HappyAbsSyn ) -> (Declaration)
-happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut13 #-}
-happyIn14 :: (Clafer) -> (HappyAbsSyn )
-happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn14 #-}
-happyOut14 :: (HappyAbsSyn ) -> (Clafer)
-happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut14 #-}
-happyIn15 :: (Constraint) -> (HappyAbsSyn )
-happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn15 #-}
-happyOut15 :: (HappyAbsSyn ) -> (Constraint)
-happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut15 #-}
-happyIn16 :: (SoftConstraint) -> (HappyAbsSyn )
-happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn16 #-}
-happyOut16 :: (HappyAbsSyn ) -> (SoftConstraint)
-happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut16 #-}
-happyIn17 :: (Goal) -> (HappyAbsSyn )
-happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn17 #-}
-happyOut17 :: (HappyAbsSyn ) -> (Goal)
-happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut17 #-}
-happyIn18 :: (Abstract) -> (HappyAbsSyn )
-happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn18 #-}
-happyOut18 :: (HappyAbsSyn ) -> (Abstract)
-happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut18 #-}
-happyIn19 :: (Elements) -> (HappyAbsSyn )
-happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn19 #-}
-happyOut19 :: (HappyAbsSyn ) -> (Elements)
-happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut19 #-}
-happyIn20 :: (Element) -> (HappyAbsSyn )
-happyIn20 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn20 #-}
-happyOut20 :: (HappyAbsSyn ) -> (Element)
-happyOut20 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut20 #-}
-happyIn21 :: (Super) -> (HappyAbsSyn )
-happyIn21 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn21 #-}
-happyOut21 :: (HappyAbsSyn ) -> (Super)
-happyOut21 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut21 #-}
-happyIn22 :: (Reference) -> (HappyAbsSyn )
-happyIn22 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn22 #-}
-happyOut22 :: (HappyAbsSyn ) -> (Reference)
-happyOut22 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut22 #-}
-happyIn23 :: (Init) -> (HappyAbsSyn )
-happyIn23 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn23 #-}
-happyOut23 :: (HappyAbsSyn ) -> (Init)
-happyOut23 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut23 #-}
-happyIn24 :: (InitHow) -> (HappyAbsSyn )
-happyIn24 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn24 #-}
-happyOut24 :: (HappyAbsSyn ) -> (InitHow)
-happyOut24 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut24 #-}
-happyIn25 :: (GCard) -> (HappyAbsSyn )
-happyIn25 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn25 #-}
-happyOut25 :: (HappyAbsSyn ) -> (GCard)
-happyOut25 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut25 #-}
-happyIn26 :: (Card) -> (HappyAbsSyn )
-happyIn26 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn26 #-}
-happyOut26 :: (HappyAbsSyn ) -> (Card)
-happyOut26 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut26 #-}
-happyIn27 :: (NCard) -> (HappyAbsSyn )
-happyIn27 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn27 #-}
-happyOut27 :: (HappyAbsSyn ) -> (NCard)
-happyOut27 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut27 #-}
-happyIn28 :: (ExInteger) -> (HappyAbsSyn )
-happyIn28 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn28 #-}
-happyOut28 :: (HappyAbsSyn ) -> (ExInteger)
-happyOut28 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut28 #-}
-happyIn29 :: (Name) -> (HappyAbsSyn )
-happyIn29 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn29 #-}
-happyOut29 :: (HappyAbsSyn ) -> (Name)
-happyOut29 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut29 #-}
-happyIn30 :: (Exp) -> (HappyAbsSyn )
-happyIn30 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn30 #-}
-happyOut30 :: (HappyAbsSyn ) -> (Exp)
-happyOut30 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut30 #-}
-happyIn31 :: (Exp) -> (HappyAbsSyn )
-happyIn31 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn31 #-}
-happyOut31 :: (HappyAbsSyn ) -> (Exp)
-happyOut31 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut31 #-}
-happyIn32 :: (Exp) -> (HappyAbsSyn )
-happyIn32 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn32 #-}
-happyOut32 :: (HappyAbsSyn ) -> (Exp)
-happyOut32 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut32 #-}
-happyIn33 :: (Exp) -> (HappyAbsSyn )
-happyIn33 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn33 #-}
-happyOut33 :: (HappyAbsSyn ) -> (Exp)
-happyOut33 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut33 #-}
-happyIn34 :: (Exp) -> (HappyAbsSyn )
-happyIn34 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn34 #-}
-happyOut34 :: (HappyAbsSyn ) -> (Exp)
-happyOut34 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut34 #-}
-happyIn35 :: (Exp) -> (HappyAbsSyn )
-happyIn35 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn35 #-}
-happyOut35 :: (HappyAbsSyn ) -> (Exp)
-happyOut35 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut35 #-}
-happyIn36 :: (Exp) -> (HappyAbsSyn )
-happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn36 #-}
-happyOut36 :: (HappyAbsSyn ) -> (Exp)
-happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut36 #-}
-happyIn37 :: (Exp) -> (HappyAbsSyn )
-happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn37 #-}
-happyOut37 :: (HappyAbsSyn ) -> (Exp)
-happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut37 #-}
-happyIn38 :: (Exp) -> (HappyAbsSyn )
-happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn38 #-}
-happyOut38 :: (HappyAbsSyn ) -> (Exp)
-happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut38 #-}
-happyIn39 :: (Exp) -> (HappyAbsSyn )
-happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn39 #-}
-happyOut39 :: (HappyAbsSyn ) -> (Exp)
-happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut39 #-}
-happyIn40 :: (Exp) -> (HappyAbsSyn )
-happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn40 #-}
-happyOut40 :: (HappyAbsSyn ) -> (Exp)
-happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut40 #-}
-happyIn41 :: (Exp) -> (HappyAbsSyn )
-happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn41 #-}
-happyOut41 :: (HappyAbsSyn ) -> (Exp)
-happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut41 #-}
-happyIn42 :: (Exp) -> (HappyAbsSyn )
-happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn42 #-}
-happyOut42 :: (HappyAbsSyn ) -> (Exp)
-happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut42 #-}
-happyIn43 :: (Exp) -> (HappyAbsSyn )
-happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn43 #-}
-happyOut43 :: (HappyAbsSyn ) -> (Exp)
-happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut43 #-}
-happyIn44 :: (SetExp) -> (HappyAbsSyn )
-happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn44 #-}
-happyOut44 :: (HappyAbsSyn ) -> (SetExp)
-happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut44 #-}
-happyIn45 :: (SetExp) -> (HappyAbsSyn )
-happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn45 #-}
-happyOut45 :: (HappyAbsSyn ) -> (SetExp)
-happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut45 #-}
-happyIn46 :: (SetExp) -> (HappyAbsSyn )
-happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn46 #-}
-happyOut46 :: (HappyAbsSyn ) -> (SetExp)
-happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut46 #-}
-happyIn47 :: (SetExp) -> (HappyAbsSyn )
-happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn47 #-}
-happyOut47 :: (HappyAbsSyn ) -> (SetExp)
-happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut47 #-}
-happyIn48 :: (SetExp) -> (HappyAbsSyn )
-happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn48 #-}
-happyOut48 :: (HappyAbsSyn ) -> (SetExp)
-happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut48 #-}
-happyIn49 :: (SetExp) -> (HappyAbsSyn )
-happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn49 #-}
-happyOut49 :: (HappyAbsSyn ) -> (SetExp)
-happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut49 #-}
-happyIn50 :: (SetExp) -> (HappyAbsSyn )
-happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn50 #-}
-happyOut50 :: (HappyAbsSyn ) -> (SetExp)
-happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut50 #-}
-happyIn51 :: (Decl) -> (HappyAbsSyn )
-happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn51 #-}
-happyOut51 :: (HappyAbsSyn ) -> (Decl)
-happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut51 #-}
-happyIn52 :: (Quant) -> (HappyAbsSyn )
-happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn52 #-}
-happyOut52 :: (HappyAbsSyn ) -> (Quant)
-happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut52 #-}
-happyIn53 :: (EnumId) -> (HappyAbsSyn )
-happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn53 #-}
-happyOut53 :: (HappyAbsSyn ) -> (EnumId)
-happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut53 #-}
-happyIn54 :: (ModId) -> (HappyAbsSyn )
-happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn54 #-}
-happyOut54 :: (HappyAbsSyn ) -> (ModId)
-happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut54 #-}
-happyIn55 :: (LocId) -> (HappyAbsSyn )
-happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn55 #-}
-happyOut55 :: (HappyAbsSyn ) -> (LocId)
-happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut55 #-}
-happyIn56 :: ([Declaration]) -> (HappyAbsSyn )
-happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn56 #-}
-happyOut56 :: (HappyAbsSyn ) -> ([Declaration])
-happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut56 #-}
-happyIn57 :: ([EnumId]) -> (HappyAbsSyn )
-happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn57 #-}
-happyOut57 :: (HappyAbsSyn ) -> ([EnumId])
-happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut57 #-}
-happyIn58 :: ([Element]) -> (HappyAbsSyn )
-happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn58 #-}
-happyOut58 :: (HappyAbsSyn ) -> ([Element])
-happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut58 #-}
-happyIn59 :: ([Exp]) -> (HappyAbsSyn )
-happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn59 #-}
-happyOut59 :: (HappyAbsSyn ) -> ([Exp])
-happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut59 #-}
-happyIn60 :: ([LocId]) -> (HappyAbsSyn )
-happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn60 #-}
-happyOut60 :: (HappyAbsSyn ) -> ([LocId])
-happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut60 #-}
-happyIn61 :: ([ModId]) -> (HappyAbsSyn )
-happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyIn61 #-}
-happyOut61 :: (HappyAbsSyn ) -> ([ModId])
-happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOut61 #-}
-happyInTok :: (Token) -> (HappyAbsSyn )
-happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyInTok #-}
-happyOutTok :: (HappyAbsSyn ) -> (Token)
-happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
-{-# INLINE happyOutTok #-}
-
-
-happyActOffsets :: HappyAddr
-happyActOffsets = HappyA# "\x00\x00\x71\x01\x5d\x01\x58\x01\x65\x01\x3e\x01\x00\x00\x38\x01\x00\x00\x38\x01\x57\x01\x2d\x01\x00\x00\x2d\x01\x10\x01\x00\x00\x2d\x01\x8b\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x39\x01\x39\x01\x5f\x01\x28\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x55\x00\x00\x00\x1d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4d\x01\x34\x01\x13\x01\x14\x01\x49\x01\x00\x00\xc4\x05\x00\x00\x72\x00\x03\x00\x00\x00\x00\x00\x00\x00\xc9\x00\x3f\x01\x43\x01\x31\x01\x33\x01\x37\x01\x00\x00\xb1\x00\x21\x01\x00\x00\xa4\x00\x26\x00\x6c\x00\x26\x00\x00\x00\xd8\xff\x26\x00\x00\x00\x8d\x00\x8d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x2f\x01\x14\x00\x05\x01\xfc\xff\x11\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\xf7\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x0c\x00\x00\x00\x00\x00\x03\x01\x26\x00\x03\x01\xe6\x00\x00\x00\xe1\x00\x08\x01\x07\x01\xd7\x00\x00\x00\x12\x01\xb8\x00\x00\x00\xc4\x05\xd3\x00\x11\x00\x00\x00\xd0\x00\xc8\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x0c\x00\x06\x00\x06\x00\x06\x00\x06\x00\xa4\x00\xa4\x00\xa4\x00\xa4\x00\xa4\x00\xa4\x00\xa4\x00\xc2\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\xd1\x00\xb0\x00\xb2\x00\xe5\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x00\x00\x00\x00\xda\x00\x0c\x00\xda\x00\xe0\x00\xc6\x00\xc4\x00\xc5\x00\x00\x00\x95\x00\x6c\x00\x00\x00\x00\x00\x00\x00\x81\x00\x0c\x00\x89\x00\x6c\x00\x26\x00\x59\x00\xfc\xff\x0c\x00\x0c\x00\x00\x00\x76\x00\x00\x00\x00\x00\x00\x00\xee\xff\x84\x00\x59\x00\x59\x00\xfb\xff\x90\x00\x00\x00\x00\x00\x59\x00\x6c\x00\x00\x00\x6c\x00\xb8\x00\x00\x00\x00\x00\x00\x00\x35\x00\x67\x00\x6c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyGotoOffsets :: HappyAddr
-happyGotoOffsets = HappyA# "\x32\x00\x20\x00\x7b\x00\x7e\x00\x77\x00\x00\x00\x00\x00\x00\x00\x47\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x6e\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\x00\x6b\x00\x00\x00\x69\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x02\x28\x00\x28\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x78\x04\x00\x00\x00\x00\xa0\x03\x7e\x05\xf9\x01\x64\x05\x00\x00\xe8\x00\x4e\x05\x00\x00\xb5\x02\x86\x02\x00\x00\x00\x00\x00\x00\x00\x00\x34\x05\x00\x00\x00\x00\x00\x00\xca\x01\x00\x00\x3d\x00\x08\x00\x00\x00\xb5\x00\x00\x00\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x87\x00\x00\x00\x00\x00\x00\x00\x29\x00\x02\x06\x00\x00\x00\x00\x00\x00\x1e\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x88\x00\xac\x05\x7c\x00\x4f\x06\x46\x06\x37\x06\x2e\x06\x18\x06\xee\x04\xd4\x04\xbe\x04\x8f\x04\x60\x04\x48\x04\x30\x04\x18\x04\x00\x04\xe8\x03\xd0\x03\x00\x00\x71\x03\x42\x03\x13\x03\xe4\x02\x57\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb8\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9b\x01\x00\x00\x00\x00\x00\x00\x00\x00\xd6\x05\x3c\x00\x6c\x01\x04\x05\x00\x00\x57\x00\xc0\x05\xaa\x05\x00\x00\x00\x00\x00\x00\x00\x00\xda\xff\x9c\x01\x70\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3d\x01\x00\x00\x0e\x01\x00\x00\x00\x00\x00\x00\x00\x00\x94\x05\x18\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyDefActions :: HappyAddr
-happyDefActions = HappyA# "\x86\xff\xef\xff\x00\x00\x00\x00\x00\x00\x00\x00\xfa\xff\x00\x00\x80\xff\x00\x00\x00\x00\x00\x00\x80\xff\x00\x00\xdd\xff\xee\xff\x00\x00\xef\xff\x85\xff\xeb\xff\xe9\xff\xe7\xff\xe8\xff\xf4\xff\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xff\xda\xff\xd9\xff\xdb\xff\xdc\xff\x00\x00\x80\xff\x00\x00\xa3\xff\xa2\xff\xa1\xff\x88\xff\x91\xff\x7f\xff\xc9\xff\xc5\xff\xc3\xff\xc1\xff\xbf\xff\xbd\xff\xbb\xff\xb2\xff\xb0\xff\xad\xff\xaa\xff\xa6\xff\xa4\xff\xa0\xff\x9c\xff\x9a\xff\x98\xff\x96\xff\x94\xff\x92\xff\x00\x00\x7c\xff\xce\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xff\x00\x00\x00\x00\x8c\xff\x00\x00\x00\x00\x8e\xff\x8d\xff\x8b\xff\x8a\xff\x00\x00\xf9\xff\xf8\xff\xf7\xff\x00\x00\xf2\xff\xe6\xff\x00\x00\x00\x00\xd7\xff\xd3\xff\xed\xff\xd2\xff\xd4\xff\xd5\xff\xd6\xff\x00\x00\xcf\xff\xd1\xff\xd0\xff\xe4\xff\x00\x00\xf1\xff\xa9\xff\xc7\xff\x00\x00\xc8\xff\x00\x00\x87\xff\x00\x00\x7e\xff\x00\x00\x00\x00\xa7\xff\x00\x00\xa0\xff\xa8\xff\xbc\xff\x00\x00\x88\xff\xb1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc6\xff\xc4\xff\xc2\xff\xc0\xff\xbe\xff\x00\x00\xb4\xff\xb6\xff\xb9\xff\xb8\xff\xb7\xff\xba\xff\xb5\xff\xae\xff\xaf\xff\xab\xff\xac\xff\x9d\xff\x00\x00\x9e\xff\x9b\xff\x99\xff\x97\xff\x95\xff\x93\xff\x00\x00\x00\x00\x7b\xff\x90\xff\x9f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe5\xff\xd7\xff\x00\x00\x00\x00\x89\xff\x84\xff\xf5\xff\xea\xff\x82\xff\xef\xff\x00\x00\xe2\xff\xe3\xff\xe1\xff\x00\x00\xcc\xff\x7d\xff\x8f\xff\x00\x00\xca\xff\x00\x00\x00\x00\xb3\xff\xcb\xff\xcd\xff\x00\x00\xed\xff\x00\x00\xde\xff\xdf\xff\x83\xff\x81\xff\xec\xff\xe0\xff\xf3\xff\xa5\xff"#
-
-happyCheck :: HappyAddr
-happyCheck = HappyA# "\xff\xff\x29\x00\x01\x00\x07\x00\x03\x00\x09\x00\x05\x00\x19\x00\x00\x00\x03\x00\x07\x00\x05\x00\x32\x00\x0c\x00\x00\x00\x14\x00\x22\x00\x05\x00\x0c\x00\x25\x00\x26\x00\x12\x00\x28\x00\x1c\x00\x0f\x00\x10\x00\x42\x00\x07\x00\x14\x00\x21\x00\x01\x00\x11\x00\x03\x00\x13\x00\x05\x00\x0b\x00\x13\x00\x24\x00\x06\x00\x16\x00\x27\x00\x0c\x00\x0a\x00\x05\x00\x3e\x00\x2c\x00\x03\x00\x2e\x00\x2f\x00\x30\x00\x2c\x00\x32\x00\x33\x00\x34\x00\x04\x00\x0e\x00\x37\x00\x38\x00\x05\x00\x3f\x00\x0b\x00\x20\x00\x38\x00\x03\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x27\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x2c\x00\x0d\x00\x2e\x00\x2f\x00\x30\x00\x42\x00\x32\x00\x33\x00\x34\x00\x2c\x00\x3f\x00\x37\x00\x38\x00\x01\x00\x00\x00\x03\x00\x2e\x00\x05\x00\x33\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x35\x00\x0c\x00\x30\x00\x0a\x00\x0b\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x12\x00\x13\x00\x2f\x00\x03\x00\x01\x00\x03\x00\x03\x00\x34\x00\x05\x00\x33\x00\x03\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x0c\x00\x24\x00\x33\x00\x09\x00\x27\x00\x03\x00\x0c\x00\x03\x00\x09\x00\x2c\x00\x07\x00\x2e\x00\x2f\x00\x30\x00\x08\x00\x32\x00\x33\x00\x34\x00\x03\x00\x03\x00\x37\x00\x38\x00\x01\x00\x15\x00\x03\x00\x15\x00\x05\x00\x27\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x2c\x00\x0c\x00\x2e\x00\x2f\x00\x30\x00\x2d\x00\x32\x00\x33\x00\x34\x00\x31\x00\x3b\x00\x37\x00\x38\x00\x29\x00\x2a\x00\x03\x00\x2e\x00\x05\x00\x2e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x35\x00\x0c\x00\x35\x00\x3c\x00\x2b\x00\x2d\x00\x00\x00\x05\x00\x2f\x00\x31\x00\x2c\x00\x2a\x00\x2e\x00\x34\x00\x3c\x00\x06\x00\x32\x00\x33\x00\x34\x00\x0a\x00\x0b\x00\x37\x00\x38\x00\x42\x00\x12\x00\x13\x00\x0e\x00\x0f\x00\x42\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x2c\x00\x3c\x00\x2e\x00\x0a\x00\x0b\x00\x10\x00\x32\x00\x33\x00\x34\x00\x15\x00\x29\x00\x37\x00\x38\x00\x2c\x00\x18\x00\x00\x00\x01\x00\x02\x00\x03\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x0d\x00\x08\x00\x04\x00\x03\x00\x03\x00\x3a\x00\x3d\x00\x1d\x00\x2d\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x42\x00\x2c\x00\x3c\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x2b\x00\x2b\x00\x35\x00\x42\x00\x2f\x00\x2f\x00\x06\x00\x42\x00\x13\x00\x34\x00\x34\x00\x3c\x00\x16\x00\x39\x00\x1d\x00\x1c\x00\x11\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x42\x00\x2c\x00\x3b\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x31\x00\x13\x00\x35\x00\x23\x00\x35\x00\x36\x00\x10\x00\x15\x00\x18\x00\x3a\x00\x08\x00\x0d\x00\x04\x00\x3a\x00\x3f\x00\x3d\x00\x1d\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x1b\x00\x2c\x00\x42\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x11\x00\x44\x00\x35\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x22\x00\x0c\x00\x42\x00\x44\x00\x3f\x00\x19\x00\x22\x00\x28\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x26\x00\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\xff\xff\x0c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\x19\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\x25\x00\x26\x00\xff\xff\x28\x00\xff\xff\x15\x00\x2b\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\x44\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x2c\x00\x15\x00\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x15\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\x34\x00\x35\x00\xff\xff\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\xff\xff\x35\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\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\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\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\x15\x00\x00\x00\x01\x00\x02\x00\x03\x00\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x03\x00\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\x15\x00\x2e\x00\x03\x00\xff\xff\xff\xff\x02\x00\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\x2a\x00\xff\xff\x2e\x00\x03\x00\x2e\x00\x17\x00\xff\xff\xff\xff\x1a\x00\x35\x00\x1c\x00\x35\x00\x1e\x00\x1f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\x2d\x00\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\x33\x00\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\x03\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\xff\xff\xff\xff\x03\x00\xff\xff\xff\xff\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x15\x00\xff\xff\xff\xff\x2e\x00\xff\xff\xff\xff\x03\x00\xff\xff\xff\xff\x15\x00\x35\x00\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\x15\x00\x2e\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\x35\x00\x15\x00\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\x00\x27\x00\x28\x00\x29\x00\x2a\x00\xff\xff\xff\xff\xff\xff\x2e\x00\xff\xff\xff\xff\x28\x00\x29\x00\x2a\x00\xff\xff\x35\x00\xff\xff\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x35\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"#
-
-happyTable :: HappyAddr
-happyTable = HappyA# "\x00\x00\x70\x00\x42\x00\x5d\x00\x43\x00\x5e\x00\x44\x00\x09\x00\x60\x00\x43\x00\x82\x00\x44\x00\xbe\x00\x45\x00\x1a\x00\xd2\x00\x0d\x00\xa5\x00\x45\x00\x19\x00\x10\x00\x83\x00\x0b\x00\xd3\x00\xcf\x00\xd0\x00\x53\x00\x63\x00\x61\x00\x5f\x00\x42\x00\x1b\x00\x43\x00\x1c\x00\x44\x00\xd7\x00\x87\xff\x66\x00\x0d\x00\x87\xff\x47\x00\x45\x00\x0e\x00\x44\x00\xd6\x00\x48\x00\x27\x00\x49\x00\x4a\x00\x4b\x00\x48\x00\x4c\x00\x4d\x00\x4e\x00\x10\x00\xb6\x00\x4f\x00\x50\x00\x44\x00\x07\x00\xbc\x00\x46\x00\x50\x00\x6b\x00\x07\x00\x51\x00\x52\x00\x53\x00\x47\x00\x07\x00\x51\x00\x52\x00\x53\x00\x48\x00\x63\x00\x49\x00\x4a\x00\x4b\x00\x53\x00\x4c\x00\x4d\x00\x4e\x00\x48\x00\x07\x00\x4f\x00\x50\x00\x42\x00\x59\x00\x43\x00\x3f\x00\x44\x00\x53\x00\x07\x00\x51\x00\x52\x00\x53\x00\xad\x00\x45\x00\x11\x00\x80\x00\x81\x00\x07\x00\x51\x00\x52\x00\x53\x00\xc2\x00\x5b\x00\x6d\x00\x55\x00\x42\x00\x57\x00\x43\x00\xc5\x00\x44\x00\x21\x00\xb9\x00\x07\x00\x51\x00\x52\x00\x53\x00\x45\x00\x55\x00\x23\x00\x84\x00\x47\x00\x27\x00\x85\x00\x27\x00\x07\x00\x48\x00\x0b\x00\x49\x00\x4a\x00\x4b\x00\x09\x00\x4c\x00\x4d\x00\x4e\x00\xb9\x00\x6b\x00\x4f\x00\x50\x00\x42\x00\x58\x00\x43\x00\x28\x00\x44\x00\x47\x00\x07\x00\x51\x00\x52\x00\x53\x00\x48\x00\x45\x00\x49\x00\x4a\x00\x4b\x00\xba\x00\x4c\x00\x4d\x00\x4e\x00\xd3\x00\xbe\x00\x4f\x00\x50\x00\xa9\x00\x3d\x00\x43\x00\x3f\x00\x44\x00\x3f\x00\x07\x00\x51\x00\x52\x00\x53\x00\x40\x00\x45\x00\x40\x00\xc0\x00\xab\x00\xba\x00\x59\x00\x44\x00\x6d\x00\xbb\x00\x48\x00\xcf\x00\x49\x00\x6e\x00\xc8\x00\xaf\x00\x4c\x00\x4d\x00\x4e\x00\x80\x00\x81\x00\x4f\x00\x50\x00\x53\x00\x5a\x00\x5b\x00\xb8\x00\xb9\x00\x53\x00\x07\x00\x51\x00\x52\x00\x53\x00\x48\x00\xca\x00\x49\x00\x80\x00\x81\x00\x7b\x00\x4c\x00\x4d\x00\x4e\x00\x7c\x00\x7a\x00\x4f\x00\x50\x00\x48\x00\x7d\x00\x24\x00\x25\x00\x26\x00\x27\x00\x07\x00\x51\x00\x52\x00\x53\x00\x7f\x00\x7e\x00\x8e\x00\x6b\x00\x6b\x00\x8f\x00\x90\x00\x91\x00\x98\x00\x07\x00\x51\x00\x52\x00\x53\x00\x28\x00\xd6\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\x53\x00\x3e\x00\xad\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\xb0\x00\x6c\x00\x40\x00\x53\x00\x6d\x00\x6d\x00\xb0\x00\x53\x00\xb2\x00\x6e\x00\x6e\x00\xb4\x00\xb3\x00\xb5\x00\x91\x00\x60\x00\x57\x00\x28\x00\xcc\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\x53\x00\x3e\x00\xbe\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x1e\x00\x65\x00\x40\x00\x76\x00\x1f\x00\x20\x00\x7b\x00\x7c\x00\x7d\x00\x21\x00\x7e\x00\x7f\x00\x8e\x00\x8f\x00\x07\x00\x90\x00\x91\x00\x28\x00\xcd\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\x92\x00\x3e\x00\x53\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x57\x00\xff\xff\x40\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x0e\x00\x23\x00\x17\x00\x53\x00\xff\xff\x07\x00\x09\x00\x0d\x00\x0b\x00\x28\x00\xc4\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\x10\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x13\x00\x14\x00\x15\x00\x16\x00\x0e\x00\x00\x00\xd4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\xc8\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x71\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\x72\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\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\x00\x00\x3e\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x92\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x67\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x69\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x93\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x94\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\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\x00\x00\x68\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x09\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x19\x00\x10\x00\x00\x00\x0b\x00\x00\x00\x28\x00\x1a\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x74\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\x00\x00\x68\x00\x28\x00\x3f\x00\xf6\xff\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\xcb\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x98\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x99\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9a\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9b\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9c\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x9d\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\x00\x00\x68\x00\x28\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x76\x00\x00\x00\x40\x00\x9e\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\x00\x00\x68\x00\x28\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x77\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x78\x00\x28\x00\x00\x00\x3f\x00\x6d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6e\x00\x40\x00\x00\x00\x9f\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\xa1\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa2\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\xc3\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x77\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x66\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6a\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x70\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x28\x00\x24\x00\x25\x00\x26\x00\x27\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x27\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\xd8\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x28\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x86\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\xaa\x00\x00\x00\x3f\x00\x27\x00\x3f\x00\x87\x00\x00\x00\x00\x00\x88\x00\x40\x00\x89\x00\x40\x00\x8a\x00\x8b\x00\xc1\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x8d\x00\x00\x00\x00\x00\xc6\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb5\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x27\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\xa3\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x28\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x27\x00\x00\x00\x00\x00\x28\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x27\x00\xa5\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x28\x00\x3f\x00\xa6\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x40\x00\x28\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\xa7\x00\x3b\x00\x3c\x00\x3d\x00\x00\x00\x00\x00\x00\x00\x3f\x00\x00\x00\x00\x00\xa8\x00\x3c\x00\x3d\x00\x00\x00\x40\x00\x00\x00\x3f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
-
-happyReduceArr = Happy_Data_Array.array (5, 132) [
-	(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)
-	]
-
-happy_n_terms = 69 :: Int
-happy_n_nonterms = 54 :: Int
-
-happyReduce_5 = happySpecReduce_1  0# happyReduction_5
-happyReduction_5 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn8
-		 (PosInteger (mkPosToken happy_var_1)
-	)}
-
-happyReduce_6 = happySpecReduce_1  1# happyReduction_6
-happyReduction_6 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn9
-		 (PosDouble (mkPosToken happy_var_1)
-	)}
-
-happyReduce_7 = happySpecReduce_1  2# happyReduction_7
-happyReduction_7 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn10
-		 (PosString (mkPosToken happy_var_1)
-	)}
-
-happyReduce_8 = happySpecReduce_1  3# happyReduction_8
-happyReduction_8 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn11
-		 (PosIdent (mkPosToken happy_var_1)
-	)}
-
-happyReduce_9 = happySpecReduce_1  4# happyReduction_9
-happyReduction_9 happy_x_1
-	 =  case happyOut56 happy_x_1 of { happy_var_1 -> 
-	happyIn12
-		 (Module ((mkCatSpan happy_var_1)) (reverse happy_var_1)
-	)}
-
-happyReduce_10 = happyReduce 4# 5# happyReduction_10
-happyReduction_10 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut11 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	case happyOut57 happy_x_4 of { happy_var_4 -> 
-	happyIn13
-		 (EnumDecl ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_4
-	) `HappyStk` happyRest}}}}
-
-happyReduce_11 = happySpecReduce_1  5# happyReduction_11
-happyReduction_11 happy_x_1
-	 =  case happyOut20 happy_x_1 of { happy_var_1 -> 
-	happyIn13
-		 (ElementDecl ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_12 = happyReduce 8# 6# happyReduction_12
-happyReduction_12 (happy_x_8 `HappyStk`
-	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 happyOut18 happy_x_1 of { happy_var_1 -> 
-	case happyOut25 happy_x_2 of { happy_var_2 -> 
-	case happyOut11 happy_x_3 of { happy_var_3 -> 
-	case happyOut21 happy_x_4 of { happy_var_4 -> 
-	case happyOut22 happy_x_5 of { happy_var_5 -> 
-	case happyOut26 happy_x_6 of { happy_var_6 -> 
-	case happyOut23 happy_x_7 of { happy_var_7 -> 
-	case happyOut19 happy_x_8 of { happy_var_8 -> 
-	happyIn14
-		 (Clafer ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkCatSpan happy_var_4) >- (mkCatSpan happy_var_5) >- (mkCatSpan happy_var_6) >- (mkCatSpan happy_var_7) >- (mkCatSpan happy_var_8)) happy_var_1 happy_var_2 happy_var_3 happy_var_4 happy_var_5 happy_var_6 happy_var_7 happy_var_8
-	) `HappyStk` happyRest}}}}}}}}
-
-happyReduce_13 = happySpecReduce_3  7# happyReduction_13
-happyReduction_13 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut59 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	happyIn15
-		 (Constraint ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
-	)}}}
-
-happyReduce_14 = happyReduce 4# 8# happyReduction_14
-happyReduction_14 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut59 happy_x_3 of { happy_var_3 -> 
-	case happyOutTok happy_x_4 of { happy_var_4 -> 
-	happyIn16
-		 (SoftConstraint ((mkTokenSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4)) (reverse happy_var_3)
-	) `HappyStk` happyRest}}}}
-
-happyReduce_15 = happySpecReduce_3  9# happyReduction_15
-happyReduction_15 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut59 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	happyIn17
-		 (Goal ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
-	)}}}
-
-happyReduce_16 = happySpecReduce_0  10# happyReduction_16
-happyReduction_16  =  happyIn18
-		 (AbstractEmpty noSpan
-	)
-
-happyReduce_17 = happySpecReduce_1  10# happyReduction_17
-happyReduction_17 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn18
-		 (Abstract ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_18 = happySpecReduce_0  11# happyReduction_18
-happyReduction_18  =  happyIn19
-		 (ElementsEmpty noSpan
-	)
-
-happyReduce_19 = happySpecReduce_3  11# happyReduction_19
-happyReduction_19 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut58 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	happyIn19
-		 (ElementsList ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3)) (reverse happy_var_2)
-	)}}}
-
-happyReduce_20 = happySpecReduce_1  12# happyReduction_20
-happyReduction_20 happy_x_1
-	 =  case happyOut14 happy_x_1 of { happy_var_1 -> 
-	happyIn20
-		 (Subclafer ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_21 = happyReduce 4# 12# happyReduction_21
-happyReduction_21 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut29 happy_x_2 of { happy_var_2 -> 
-	case happyOut26 happy_x_3 of { happy_var_3 -> 
-	case happyOut19 happy_x_4 of { happy_var_4 -> 
-	happyIn20
-		 (ClaferUse ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_3 happy_var_4
-	) `HappyStk` happyRest}}}}
-
-happyReduce_22 = happySpecReduce_1  12# happyReduction_22
-happyReduction_22 happy_x_1
-	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
-	happyIn20
-		 (Subconstraint ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_23 = happySpecReduce_1  12# happyReduction_23
-happyReduction_23 happy_x_1
-	 =  case happyOut17 happy_x_1 of { happy_var_1 -> 
-	happyIn20
-		 (Subgoal ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_24 = happySpecReduce_1  12# happyReduction_24
-happyReduction_24 happy_x_1
-	 =  case happyOut16 happy_x_1 of { happy_var_1 -> 
-	happyIn20
-		 (Subsoftconstraint ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_25 = happySpecReduce_0  13# happyReduction_25
-happyReduction_25  =  happyIn21
-		 (SuperEmpty noSpan
-	)
-
-happyReduce_26 = happySpecReduce_2  13# happyReduction_26
-happyReduction_26 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut44 happy_x_2 of { happy_var_2 -> 
-	happyIn21
-		 (SuperSome ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_27 = happySpecReduce_0  14# happyReduction_27
-happyReduction_27  =  happyIn22
-		 (ReferenceEmpty noSpan
-	)
-
-happyReduce_28 = happySpecReduce_2  14# happyReduction_28
-happyReduction_28 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut44 happy_x_2 of { happy_var_2 -> 
-	happyIn22
-		 (ReferenceSet ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_29 = happySpecReduce_2  14# happyReduction_29
-happyReduction_29 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut44 happy_x_2 of { happy_var_2 -> 
-	happyIn22
-		 (ReferenceBag ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_30 = happySpecReduce_0  15# happyReduction_30
-happyReduction_30  =  happyIn23
-		 (InitEmpty noSpan
-	)
-
-happyReduce_31 = happySpecReduce_2  15# happyReduction_31
-happyReduction_31 happy_x_2
-	happy_x_1
-	 =  case happyOut24 happy_x_1 of { happy_var_1 -> 
-	case happyOut30 happy_x_2 of { happy_var_2 -> 
-	happyIn23
-		 (InitSome ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_32 = happySpecReduce_1  16# happyReduction_32
-happyReduction_32 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn24
-		 (InitConstant ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_33 = happySpecReduce_1  16# happyReduction_33
-happyReduction_33 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn24
-		 (InitDefault ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_34 = happySpecReduce_0  17# happyReduction_34
-happyReduction_34  =  happyIn25
-		 (GCardEmpty noSpan
-	)
-
-happyReduce_35 = happySpecReduce_1  17# happyReduction_35
-happyReduction_35 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn25
-		 (GCardXor ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_36 = happySpecReduce_1  17# happyReduction_36
-happyReduction_36 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn25
-		 (GCardOr ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_37 = happySpecReduce_1  17# happyReduction_37
-happyReduction_37 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn25
-		 (GCardMux ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_38 = happySpecReduce_1  17# happyReduction_38
-happyReduction_38 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn25
-		 (GCardOpt ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_39 = happySpecReduce_1  17# happyReduction_39
-happyReduction_39 happy_x_1
-	 =  case happyOut27 happy_x_1 of { happy_var_1 -> 
-	happyIn25
-		 (GCardInterval ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_40 = happySpecReduce_0  18# happyReduction_40
-happyReduction_40  =  happyIn26
-		 (CardEmpty noSpan
-	)
-
-happyReduce_41 = happySpecReduce_1  18# happyReduction_41
-happyReduction_41 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn26
-		 (CardLone ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_42 = happySpecReduce_1  18# happyReduction_42
-happyReduction_42 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn26
-		 (CardSome ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_43 = happySpecReduce_1  18# happyReduction_43
-happyReduction_43 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn26
-		 (CardAny ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_44 = happySpecReduce_1  18# happyReduction_44
-happyReduction_44 happy_x_1
-	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
-	happyIn26
-		 (CardNum ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_45 = happySpecReduce_1  18# happyReduction_45
-happyReduction_45 happy_x_1
-	 =  case happyOut27 happy_x_1 of { happy_var_1 -> 
-	happyIn26
-		 (CardInterval ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_46 = happySpecReduce_3  19# happyReduction_46
-happyReduction_46 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut28 happy_x_3 of { happy_var_3 -> 
-	happyIn27
-		 (NCard ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_47 = happySpecReduce_1  20# happyReduction_47
-happyReduction_47 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn28
-		 (ExIntegerAst ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_48 = happySpecReduce_1  20# happyReduction_48
-happyReduction_48 happy_x_1
-	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
-	happyIn28
-		 (ExIntegerNum ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_49 = happySpecReduce_1  21# happyReduction_49
-happyReduction_49 happy_x_1
-	 =  case happyOut61 happy_x_1 of { happy_var_1 -> 
-	happyIn29
-		 (Path ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_50 = happyReduce 5# 22# happyReduction_50
-happyReduction_50 (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 { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut51 happy_x_3 of { happy_var_3 -> 
-	case happyOutTok happy_x_4 of { happy_var_4 -> 
-	case happyOut30 happy_x_5 of { happy_var_5 -> 
-	happyIn30
-		 (DeclAllDisj ((mkTokenSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4) >- (mkCatSpan happy_var_5)) happy_var_3 happy_var_5
-	) `HappyStk` happyRest}}}}}
-
-happyReduce_51 = happyReduce 4# 22# happyReduction_51
-happyReduction_51 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	case happyOut30 happy_x_4 of { happy_var_4 -> 
-	happyIn30
-		 (DeclAll ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_2 happy_var_4
-	) `HappyStk` happyRest}}}}
-
-happyReduce_52 = happyReduce 5# 22# happyReduction_52
-happyReduction_52 (happy_x_5 `HappyStk`
-	happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut52 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut51 happy_x_3 of { happy_var_3 -> 
-	case happyOutTok happy_x_4 of { happy_var_4 -> 
-	case happyOut30 happy_x_5 of { happy_var_5 -> 
-	happyIn30
-		 (DeclQuantDisj ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3) >- (mkTokenSpan happy_var_4) >- (mkCatSpan happy_var_5)) happy_var_1 happy_var_3 happy_var_5
-	) `HappyStk` happyRest}}}}}
-
-happyReduce_53 = happyReduce 4# 22# happyReduction_53
-happyReduction_53 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut52 happy_x_1 of { happy_var_1 -> 
-	case happyOut51 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	case happyOut30 happy_x_4 of { happy_var_4 -> 
-	happyIn30
-		 (DeclQuant ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_1 happy_var_2 happy_var_4
-	) `HappyStk` happyRest}}}}
-
-happyReduce_54 = happySpecReduce_1  22# happyReduction_54
-happyReduction_54 happy_x_1
-	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
-	happyIn30
-		 (happy_var_1
-	)}
-
-happyReduce_55 = happySpecReduce_2  23# happyReduction_55
-happyReduction_55 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut32 happy_x_2 of { happy_var_2 -> 
-	happyIn31
-		 (EGMax ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_56 = happySpecReduce_2  23# happyReduction_56
-happyReduction_56 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut32 happy_x_2 of { happy_var_2 -> 
-	happyIn31
-		 (EGMin ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_57 = happySpecReduce_3  23# happyReduction_57
-happyReduction_57 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut32 happy_x_3 of { happy_var_3 -> 
-	happyIn31
-		 (EIff ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_58 = happySpecReduce_1  23# happyReduction_58
-happyReduction_58 happy_x_1
-	 =  case happyOut32 happy_x_1 of { happy_var_1 -> 
-	happyIn31
-		 (happy_var_1
-	)}
-
-happyReduce_59 = happySpecReduce_3  24# happyReduction_59
-happyReduction_59 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut32 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut33 happy_x_3 of { happy_var_3 -> 
-	happyIn32
-		 (EImplies ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_60 = happySpecReduce_1  24# happyReduction_60
-happyReduction_60 happy_x_1
-	 =  case happyOut33 happy_x_1 of { happy_var_1 -> 
-	happyIn32
-		 (happy_var_1
-	)}
-
-happyReduce_61 = happySpecReduce_3  25# happyReduction_61
-happyReduction_61 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut33 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut34 happy_x_3 of { happy_var_3 -> 
-	happyIn33
-		 (EOr ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_62 = happySpecReduce_1  25# happyReduction_62
-happyReduction_62 happy_x_1
-	 =  case happyOut34 happy_x_1 of { happy_var_1 -> 
-	happyIn33
-		 (happy_var_1
-	)}
-
-happyReduce_63 = happySpecReduce_3  26# happyReduction_63
-happyReduction_63 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut34 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut35 happy_x_3 of { happy_var_3 -> 
-	happyIn34
-		 (EXor ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_64 = happySpecReduce_1  26# happyReduction_64
-happyReduction_64 happy_x_1
-	 =  case happyOut35 happy_x_1 of { happy_var_1 -> 
-	happyIn34
-		 (happy_var_1
-	)}
-
-happyReduce_65 = happySpecReduce_3  27# happyReduction_65
-happyReduction_65 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut35 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut36 happy_x_3 of { happy_var_3 -> 
-	happyIn35
-		 (EAnd ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_66 = happySpecReduce_1  27# happyReduction_66
-happyReduction_66 happy_x_1
-	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
-	happyIn35
-		 (happy_var_1
-	)}
-
-happyReduce_67 = happySpecReduce_2  28# happyReduction_67
-happyReduction_67 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut37 happy_x_2 of { happy_var_2 -> 
-	happyIn36
-		 (ENeg ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_68 = happySpecReduce_1  28# happyReduction_68
-happyReduction_68 happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	happyIn36
-		 (happy_var_1
-	)}
-
-happyReduce_69 = happySpecReduce_3  29# happyReduction_69
-happyReduction_69 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (ELt ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_70 = happySpecReduce_3  29# happyReduction_70
-happyReduction_70 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (EGt ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_71 = happySpecReduce_3  29# happyReduction_71
-happyReduction_71 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (EEq ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_72 = happySpecReduce_3  29# happyReduction_72
-happyReduction_72 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (ELte ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_73 = happySpecReduce_3  29# happyReduction_73
-happyReduction_73 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (EGte ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_74 = happySpecReduce_3  29# happyReduction_74
-happyReduction_74 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (ENeq ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_75 = happySpecReduce_3  29# happyReduction_75
-happyReduction_75 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut38 happy_x_3 of { happy_var_3 -> 
-	happyIn37
-		 (EIn ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_76 = happyReduce 4# 29# happyReduction_76
-happyReduction_76 (happy_x_4 `HappyStk`
-	happy_x_3 `HappyStk`
-	happy_x_2 `HappyStk`
-	happy_x_1 `HappyStk`
-	happyRest)
-	 = case happyOut37 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	case happyOut38 happy_x_4 of { happy_var_4 -> 
-	happyIn37
-		 (ENin ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4)) happy_var_1 happy_var_4
-	) `HappyStk` happyRest}}}}
-
-happyReduce_77 = happySpecReduce_1  29# happyReduction_77
-happyReduction_77 happy_x_1
-	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
-	happyIn37
-		 (happy_var_1
-	)}
-
-happyReduce_78 = happySpecReduce_2  30# happyReduction_78
-happyReduction_78 happy_x_2
-	happy_x_1
-	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
-	case happyOut42 happy_x_2 of { happy_var_2 -> 
-	happyIn38
-		 (QuantExp ((mkCatSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_1 happy_var_2
-	)}}
-
-happyReduce_79 = happySpecReduce_1  30# happyReduction_79
-happyReduction_79 happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	happyIn38
-		 (happy_var_1
-	)}
-
-happyReduce_80 = happySpecReduce_3  31# happyReduction_80
-happyReduction_80 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut40 happy_x_3 of { happy_var_3 -> 
-	happyIn39
-		 (EAdd ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_81 = happySpecReduce_3  31# happyReduction_81
-happyReduction_81 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut40 happy_x_3 of { happy_var_3 -> 
-	happyIn39
-		 (ESub ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_82 = happySpecReduce_1  31# happyReduction_82
-happyReduction_82 happy_x_1
-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
-	happyIn39
-		 (happy_var_1
-	)}
-
-happyReduce_83 = happySpecReduce_3  32# happyReduction_83
-happyReduction_83 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut41 happy_x_3 of { happy_var_3 -> 
-	happyIn40
-		 (EMul ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_84 = happySpecReduce_3  32# happyReduction_84
-happyReduction_84 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut40 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut41 happy_x_3 of { happy_var_3 -> 
-	happyIn40
-		 (EDiv ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_85 = happySpecReduce_1  32# happyReduction_85
-happyReduction_85 happy_x_1
-	 =  case happyOut41 happy_x_1 of { happy_var_1 -> 
-	happyIn40
-		 (happy_var_1
-	)}
-
-happyReduce_86 = happySpecReduce_2  33# happyReduction_86
-happyReduction_86 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut42 happy_x_2 of { happy_var_2 -> 
-	happyIn41
-		 (ESumSetExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_87 = happySpecReduce_2  33# happyReduction_87
-happyReduction_87 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut42 happy_x_2 of { happy_var_2 -> 
-	happyIn41
-		 (ECSetExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_88 = happySpecReduce_2  33# happyReduction_88
-happyReduction_88 happy_x_2
-	happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	case happyOut42 happy_x_2 of { happy_var_2 -> 
-	happyIn41
-		 (EMinExp ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2)) happy_var_2
-	)}}
-
-happyReduce_89 = happySpecReduce_1  33# happyReduction_89
-happyReduction_89 happy_x_1
-	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
-	happyIn41
-		 (happy_var_1
-	)}
-
-happyReduce_90 = happyReduce 6# 34# happyReduction_90
-happyReduction_90 (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 { happy_var_1 -> 
-	case happyOut42 happy_x_2 of { happy_var_2 -> 
-	case happyOutTok happy_x_3 of { happy_var_3 -> 
-	case happyOut42 happy_x_4 of { happy_var_4 -> 
-	case happyOutTok happy_x_5 of { happy_var_5 -> 
-	case happyOut43 happy_x_6 of { happy_var_6 -> 
-	happyIn42
-		 (EImpliesElse ((mkTokenSpan happy_var_1) >- (mkCatSpan happy_var_2) >- (mkTokenSpan happy_var_3) >- (mkCatSpan happy_var_4) >- (mkTokenSpan happy_var_5) >- (mkCatSpan happy_var_6)) happy_var_2 happy_var_4 happy_var_6
-	) `HappyStk` happyRest}}}}}}
-
-happyReduce_91 = happySpecReduce_1  34# happyReduction_91
-happyReduction_91 happy_x_1
-	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
-	happyIn42
-		 (happy_var_1
-	)}
-
-happyReduce_92 = happySpecReduce_1  35# happyReduction_92
-happyReduction_92 happy_x_1
-	 =  case happyOut8 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 (EInt ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_93 = happySpecReduce_1  35# happyReduction_93
-happyReduction_93 happy_x_1
-	 =  case happyOut9 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 (EDouble ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_94 = happySpecReduce_1  35# happyReduction_94
-happyReduction_94 happy_x_1
-	 =  case happyOut10 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 (EStr ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_95 = happySpecReduce_1  35# happyReduction_95
-happyReduction_95 happy_x_1
-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
-	happyIn43
-		 (ESetExp ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_96 = happySpecReduce_3  35# happyReduction_96
-happyReduction_96 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut30 happy_x_2 of { happy_var_2 -> 
-	happyIn43
-		 (happy_var_2
-	)}
-
-happyReduce_97 = happySpecReduce_3  36# happyReduction_97
-happyReduction_97 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut45 happy_x_3 of { happy_var_3 -> 
-	happyIn44
-		 (Union ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_98 = happySpecReduce_3  36# happyReduction_98
-happyReduction_98 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut45 happy_x_3 of { happy_var_3 -> 
-	happyIn44
-		 (UnionCom ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_99 = happySpecReduce_1  36# happyReduction_99
-happyReduction_99 happy_x_1
-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
-	happyIn44
-		 (happy_var_1
-	)}
-
-happyReduce_100 = happySpecReduce_3  37# happyReduction_100
-happyReduction_100 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut46 happy_x_3 of { happy_var_3 -> 
-	happyIn45
-		 (Difference ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_101 = happySpecReduce_1  37# happyReduction_101
-happyReduction_101 happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	happyIn45
-		 (happy_var_1
-	)}
-
-happyReduce_102 = happySpecReduce_3  38# happyReduction_102
-happyReduction_102 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut47 happy_x_3 of { happy_var_3 -> 
-	happyIn46
-		 (Intersection ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_103 = happySpecReduce_1  38# happyReduction_103
-happyReduction_103 happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	happyIn46
-		 (happy_var_1
-	)}
-
-happyReduce_104 = happySpecReduce_3  39# happyReduction_104
-happyReduction_104 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut47 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut48 happy_x_3 of { happy_var_3 -> 
-	happyIn47
-		 (Domain ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_105 = happySpecReduce_1  39# happyReduction_105
-happyReduction_105 happy_x_1
-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> 
-	happyIn47
-		 (happy_var_1
-	)}
-
-happyReduce_106 = happySpecReduce_3  40# happyReduction_106
-happyReduction_106 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut48 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut49 happy_x_3 of { happy_var_3 -> 
-	happyIn48
-		 (Range ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_107 = happySpecReduce_1  40# happyReduction_107
-happyReduction_107 happy_x_1
-	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
-	happyIn48
-		 (happy_var_1
-	)}
-
-happyReduce_108 = happySpecReduce_3  41# happyReduction_108
-happyReduction_108 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut49 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut50 happy_x_3 of { happy_var_3 -> 
-	happyIn49
-		 (Join ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_109 = happySpecReduce_1  41# happyReduction_109
-happyReduction_109 happy_x_1
-	 =  case happyOut50 happy_x_1 of { happy_var_1 -> 
-	happyIn49
-		 (happy_var_1
-	)}
-
-happyReduce_110 = happySpecReduce_1  42# happyReduction_110
-happyReduction_110 happy_x_1
-	 =  case happyOut29 happy_x_1 of { happy_var_1 -> 
-	happyIn50
-		 (ClaferId ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_111 = happySpecReduce_3  42# happyReduction_111
-happyReduction_111 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut44 happy_x_2 of { happy_var_2 -> 
-	happyIn50
-		 (happy_var_2
-	)}
-
-happyReduce_112 = happySpecReduce_3  43# happyReduction_112
-happyReduction_112 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
-	case happyOutTok happy_x_2 of { happy_var_2 -> 
-	case happyOut44 happy_x_3 of { happy_var_3 -> 
-	happyIn51
-		 (Decl ((mkCatSpan happy_var_1) >- (mkTokenSpan happy_var_2) >- (mkCatSpan happy_var_3)) happy_var_1 happy_var_3
-	)}}}
-
-happyReduce_113 = happySpecReduce_1  44# happyReduction_113
-happyReduction_113 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn52
-		 (QuantNo ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_114 = happySpecReduce_1  44# happyReduction_114
-happyReduction_114 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn52
-		 (QuantNot ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_115 = happySpecReduce_1  44# happyReduction_115
-happyReduction_115 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn52
-		 (QuantLone ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_116 = happySpecReduce_1  44# happyReduction_116
-happyReduction_116 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn52
-		 (QuantOne ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_117 = happySpecReduce_1  44# happyReduction_117
-happyReduction_117 happy_x_1
-	 =  case happyOutTok happy_x_1 of { happy_var_1 -> 
-	happyIn52
-		 (QuantSome ((mkTokenSpan happy_var_1))
-	)}
-
-happyReduce_118 = happySpecReduce_1  45# happyReduction_118
-happyReduction_118 happy_x_1
-	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
-	happyIn53
-		 (EnumIdIdent ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_119 = happySpecReduce_1  46# happyReduction_119
-happyReduction_119 happy_x_1
-	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
-	happyIn54
-		 (ModIdIdent ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_120 = happySpecReduce_1  47# happyReduction_120
-happyReduction_120 happy_x_1
-	 =  case happyOut11 happy_x_1 of { happy_var_1 -> 
-	happyIn55
-		 (LocIdIdent ((mkCatSpan happy_var_1)) happy_var_1
-	)}
-
-happyReduce_121 = happySpecReduce_0  48# happyReduction_121
-happyReduction_121  =  happyIn56
-		 ([]
-	)
-
-happyReduce_122 = happySpecReduce_2  48# happyReduction_122
-happyReduction_122 happy_x_2
-	happy_x_1
-	 =  case happyOut56 happy_x_1 of { happy_var_1 -> 
-	case happyOut13 happy_x_2 of { happy_var_2 -> 
-	happyIn56
-		 (flip (:)  happy_var_1 happy_var_2
-	)}}
-
-happyReduce_123 = happySpecReduce_1  49# happyReduction_123
-happyReduction_123 happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	happyIn57
-		 ((:[])  happy_var_1
-	)}
-
-happyReduce_124 = happySpecReduce_3  49# happyReduction_124
-happyReduction_124 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
-	case happyOut57 happy_x_3 of { happy_var_3 -> 
-	happyIn57
-		 ((:)  happy_var_1 happy_var_3
-	)}}
-
-happyReduce_125 = happySpecReduce_0  50# happyReduction_125
-happyReduction_125  =  happyIn58
-		 ([]
-	)
-
-happyReduce_126 = happySpecReduce_2  50# happyReduction_126
-happyReduction_126 happy_x_2
-	happy_x_1
-	 =  case happyOut58 happy_x_1 of { happy_var_1 -> 
-	case happyOut20 happy_x_2 of { happy_var_2 -> 
-	happyIn58
-		 (flip (:)  happy_var_1 happy_var_2
-	)}}
-
-happyReduce_127 = happySpecReduce_0  51# happyReduction_127
-happyReduction_127  =  happyIn59
-		 ([]
-	)
-
-happyReduce_128 = happySpecReduce_2  51# happyReduction_128
-happyReduction_128 happy_x_2
-	happy_x_1
-	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
-	case happyOut30 happy_x_2 of { happy_var_2 -> 
-	happyIn59
-		 (flip (:)  happy_var_1 happy_var_2
-	)}}
-
-happyReduce_129 = happySpecReduce_1  52# happyReduction_129
-happyReduction_129 happy_x_1
-	 =  case happyOut55 happy_x_1 of { happy_var_1 -> 
-	happyIn60
-		 ((:[])  happy_var_1
-	)}
-
-happyReduce_130 = happySpecReduce_3  52# happyReduction_130
-happyReduction_130 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut55 happy_x_1 of { happy_var_1 -> 
-	case happyOut60 happy_x_3 of { happy_var_3 -> 
-	happyIn60
-		 ((:)  happy_var_1 happy_var_3
-	)}}
-
-happyReduce_131 = happySpecReduce_1  53# happyReduction_131
-happyReduction_131 happy_x_1
-	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
-	happyIn61
-		 ((:[])  happy_var_1
-	)}
-
-happyReduce_132 = happySpecReduce_3  53# happyReduction_132
-happyReduction_132 happy_x_3
-	happy_x_2
-	happy_x_1
-	 =  case happyOut54 happy_x_1 of { happy_var_1 -> 
-	case happyOut61 happy_x_3 of { happy_var_3 -> 
-	happyIn61
-		 ((:)  happy_var_1 happy_var_3
-	)}}
-
-happyNewToken action sts stk [] =
-	happyDoAction 68# notHappyAtAll action sts stk []
-
-happyNewToken action sts stk (tk:tks) =
-	let cont i = happyDoAction i tk action sts stk tks in
-	case tk of {
-	PT _ (TS _ 1) -> cont 1#;
-	PT _ (TS _ 2) -> cont 2#;
-	PT _ (TS _ 3) -> cont 3#;
-	PT _ (TS _ 4) -> cont 4#;
-	PT _ (TS _ 5) -> cont 5#;
-	PT _ (TS _ 6) -> cont 6#;
-	PT _ (TS _ 7) -> cont 7#;
-	PT _ (TS _ 8) -> cont 8#;
-	PT _ (TS _ 9) -> cont 9#;
-	PT _ (TS _ 10) -> cont 10#;
-	PT _ (TS _ 11) -> cont 11#;
-	PT _ (TS _ 12) -> cont 12#;
-	PT _ (TS _ 13) -> cont 13#;
-	PT _ (TS _ 14) -> cont 14#;
-	PT _ (TS _ 15) -> cont 15#;
-	PT _ (TS _ 16) -> cont 16#;
-	PT _ (TS _ 17) -> cont 17#;
-	PT _ (TS _ 18) -> cont 18#;
-	PT _ (TS _ 19) -> cont 19#;
-	PT _ (TS _ 20) -> cont 20#;
-	PT _ (TS _ 21) -> cont 21#;
-	PT _ (TS _ 22) -> cont 22#;
-	PT _ (TS _ 23) -> cont 23#;
-	PT _ (TS _ 24) -> cont 24#;
-	PT _ (TS _ 25) -> cont 25#;
-	PT _ (TS _ 26) -> cont 26#;
-	PT _ (TS _ 27) -> cont 27#;
-	PT _ (TS _ 28) -> cont 28#;
-	PT _ (TS _ 29) -> cont 29#;
-	PT _ (TS _ 30) -> cont 30#;
-	PT _ (TS _ 31) -> cont 31#;
-	PT _ (TS _ 32) -> cont 32#;
-	PT _ (TS _ 33) -> cont 33#;
-	PT _ (TS _ 34) -> cont 34#;
-	PT _ (TS _ 35) -> cont 35#;
-	PT _ (TS _ 36) -> cont 36#;
-	PT _ (TS _ 37) -> cont 37#;
-	PT _ (TS _ 38) -> cont 38#;
-	PT _ (TS _ 39) -> cont 39#;
-	PT _ (TS _ 40) -> cont 40#;
-	PT _ (TS _ 41) -> cont 41#;
-	PT _ (TS _ 42) -> cont 42#;
-	PT _ (TS _ 43) -> cont 43#;
-	PT _ (TS _ 44) -> cont 44#;
-	PT _ (TS _ 45) -> cont 45#;
-	PT _ (TS _ 46) -> cont 46#;
-	PT _ (TS _ 47) -> cont 47#;
-	PT _ (TS _ 48) -> cont 48#;
-	PT _ (TS _ 49) -> cont 49#;
-	PT _ (TS _ 50) -> cont 50#;
-	PT _ (TS _ 51) -> cont 51#;
-	PT _ (TS _ 52) -> cont 52#;
-	PT _ (TS _ 53) -> cont 53#;
-	PT _ (TS _ 54) -> cont 54#;
-	PT _ (TS _ 55) -> cont 55#;
-	PT _ (TS _ 56) -> cont 56#;
-	PT _ (TS _ 57) -> cont 57#;
-	PT _ (TS _ 58) -> cont 58#;
-	PT _ (TS _ 59) -> cont 59#;
-	PT _ (TS _ 60) -> cont 60#;
-	PT _ (TS _ 61) -> cont 61#;
-	PT _ (TS _ 62) -> cont 62#;
-	PT _ (T_PosInteger _) -> cont 63#;
-	PT _ (T_PosDouble _) -> cont 64#;
-	PT _ (T_PosString _) -> cont 65#;
-	PT _ (T_PosIdent _) -> cont 66#;
-	_ -> cont 67#;
-	_ -> happyError' (tk:tks)
-	}
-
-happyError_ 68# tk tks = happyError' tks
-happyError_ _ tk tks = happyError' (tk:tks)
-
-happyThen :: () => Err a -> (a -> Err b) -> Err b
-happyThen = (thenM)
-happyReturn :: () => a -> Err a
-happyReturn = (returnM)
-happyThen1 m k tks = (thenM) m (\a -> k a tks)
-happyReturn1 :: () => a -> b -> Err a
-happyReturn1 = \a tks -> (returnM) a
-happyError' :: () => [(Token)] -> Err a
-happyError' = happyError
-
-pModule tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut12 x))
-
-pClafer tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut14 x))
-
-pConstraint tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut15 x))
-
-pSoftConstraint tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut16 x))
-
-pGoal tks = happySomeParser where
-  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut17 x))
-
-happySeq = happyDontSeq
-
-
-returnM :: a -> Err a
-returnM = return
-
-thenM :: Err a -> (a -> Err b) -> Err b
-thenM = (>>=)
-
-happyError :: [Token] -> Err a
-happyError ts =
-  Bad (pp ts) $
-  case ts of
-    [] -> []
-    [Err _] -> " due to lexer error"
-    _ -> "before " ++ unwords (map (id . prToken) (take 4 ts))
-
-gp x@(PT (Pn _ l c) _) = Span (Pos (toInteger l) (toInteger c)) (Pos (toInteger l) (toInteger c + toInteger (length $ prToken x)))
-pp (PT (Pn _ l c) _ :_) = Pos (toInteger l) (toInteger c)
-pp (Err (Pn _ l c) :_) = Pos (toInteger l) (toInteger c)
-pp _ = error "EOF"
-
-mkCatSpan :: (Spannable c) => c -> Span
-mkCatSpan = getSpan
-
-mkTokenSpan :: Token -> Span
-mkTokenSpan = gp
-myLexer = tokens
-{-# 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/src/Language/Clafer.hs b/src/Language/Clafer.hs
--- a/src/Language/Clafer.hs
+++ b/src/Language/Clafer.hs
@@ -32,7 +32,7 @@
 >       addModuleFragment b
 >       parse
 >       compile
->       generateFragments
+>       generate
 
 Example of compiling a model consisting of one fragment:
 
@@ -45,8 +45,6 @@
 >       compile
 >       generate
 
-Use "generateFragments" instead to generate output based on their fragments.
-
 > compileTwoFragments :: ClaferArgs -> InputModel -> InputModel -> Either ClaferErr [String]
 > compileTwoFragments args frag1 frag2 =
 >   runClafer args $
@@ -55,7 +53,7 @@
 >      addModuleFragment frag2
 >      parse
 >      compile
->      generateFragments
+>      generate
 
 Use "throwErr" to halt execution:
 
@@ -71,7 +69,6 @@
                         desugar,
                         generate,
                         generateHtml,
-                        generateFragments,
                         runClaferT,
                         runClafer,
                         ClaferErr,
@@ -100,7 +97,6 @@
 import Data.List
 import Data.Maybe
 import qualified Data.Map as Map
-import Data.Ord
 import Control.Monad
 import Control.Monad.State
 import Control.Lens.Plated
@@ -115,10 +111,10 @@
 import qualified Language.Clafer.ClaferArgs as Mode (ClaferMode (Clafer))
 import Language.Clafer.Comments
 import qualified Language.Clafer.Css as Css
-import Language.Clafer.Front.Lexclafer
-import Language.Clafer.Front.Parclafer
-import Language.Clafer.Front.Printclafer
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.LexClafer
+import Language.Clafer.Front.ParClafer
+import Language.Clafer.Front.PrintClafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Front.LayoutResolver
 import Language.Clafer.Intermediate.Tracing
 import Language.Clafer.Intermediate.Intclafer
@@ -425,41 +421,7 @@
       gt1 (IRClafer (IClafer (Span (Pos l c) _) False _ _ _ _ _ _ (Just (_, m)) _ _)) = if (m > 1 || m < 0) then ("Line " ++ show l ++ " column " ++ show c ++ "\n") else ""
       gt1 _ = ""
 
--- | Splits the IR into their fragments, and generates the output for each fragment.
--- | Might not generate the entire output (for example, Alloy scope and run commands) because
--- | they do not belong in fragments.
-generateFragments :: Monad m => ClaferT m [String]
-generateFragments =
-  do
-    env <- getEnv
-    (iModule, _, _) <- getIr
-    fragElems <- fragment (sortBy (comparing rnge) $ _mDecls iModule) (frags env)
 
-    -- Assumes output mode is Alloy for now
-
-    return $ map (generateFragment $ args env) fragElems
-  where
-  rnge (IEClafer IClafer{_cinPos = p}) = p
-  rnge IEConstraint{_cpexp = PExp{_inPos = p}} = p
-  rnge IEGoal{_cpexp = PExp{_inPos = p}} = p
-
-  -- Groups IElements by their fragments.
-  --   elems must be sorted by range.
-  fragment :: (Monad m) => [IElement] -> [Pos] -> ClaferT m [[IElement]]
-  fragment [] [] = return []
-  fragment elems (frag : rest) =
-    fragment restFrags rest >>= return . (curFrag:)
-    where
-    (curFrag, restFrags) = span (`beforePos` frag) elems
-  fragment _ [] = throwErr $ (ClaferErr $ "Unexpected fragment." :: CErr Span) -- Should not happen. Bug.
-
-  beforePos ele p =
-    case rnge ele of
-      Span _ e -> e <= p
-  generateFragment :: ClaferArgs -> [IElement] -> String
-  generateFragment args' frag =
-    flatten $ cconcat $ map (genDeclaration args') frag
-
 -- | Splits the AST into their fragments, and generates the output for each fragment.
 generateHtml :: ClaferEnv -> String
 generateHtml env =
@@ -490,15 +452,26 @@
     printComments [] = []
     printComments ((s, comment):cs) = (snd (printComment s [(s, comment)]) ++ "<br>\n"):printComments cs
 
-noReals :: IModule -> Bool
-noReals iModule = reals == []
+iExpBasedChecks :: IModule -> (Bool, Bool)
+iExpBasedChecks iModule = (null realLiterals, null productOperators)
   where
     iexps :: [ IExp ]
     iexps = universeOn biplate iModule
-    reals = filter isIDouble iexps
+    realLiterals = filter isIDouble iexps
+    productOperators = filter isProductOperator iexps
     isIDouble (IDouble _) = True
     isIDouble _           = False
+    isProductOperator (IFunExp op' _) = op' == iProdSet
+    isProductOperator _               = False
 
+iClaferBasedChecks :: IModule -> Bool
+iClaferBasedChecks iModule = null $ filter hasReferenceToReal iClafers
+  where
+    iClafers :: [ IClafer ]
+    iClafers = universeOn biplate iModule
+    hasReferenceToReal (IClafer{_reference=(Just IReference{_ref=pexp'})}) = (getSuperId pexp') == "real"
+    hasReferenceToReal _               = False
+
 -- | Generates outputs for the given IR.
 generate :: Monad m => ClaferT m (Map.Map ClaferMode CompilerResult)
 generate =
@@ -507,7 +480,8 @@
     ast' <- getAst
     (iModule, genv, au) <- getIr
     let
-      hasNoReals = noReals iModule
+      (hasNoRealLiterals, hasNoProductOperator) = iExpBasedChecks iModule
+      hasNoReferenceToReal = iClaferBasedChecks iModule
       cargs = args env
       modes = mode cargs
       stats = showStats au $ statsModule iModule
@@ -516,7 +490,7 @@
     return $ Map.fromList (
         -- result for Alloy
         (if (Alloy `elem` modes)
-          then if (hasNoReals)
+          then if (hasNoRealLiterals && hasNoReferenceToReal && hasNoProductOperator)
                 then
                   let
                     (imod,strMap) = astrModule iModule
@@ -536,7 +510,11 @@
                     ]
                 else [ (Alloy,
                         NoCompilerResult {
-                         reason = "Alloy output unavailable because the model contains real numbers."
+                         reason = "Alloy output unavailable because the model contains: "
+                                ++ (if hasNoRealLiterals then "" else " | a real number literal")
+                                ++ (if hasNoReferenceToReal then "" else " | a reference to a real")
+                                ++ (if hasNoProductOperator then "" else " | the product operator")
+                                ++ "."
                         })
                      ]
           else []
@@ -544,7 +522,7 @@
         ++
         -- result for Alloy42
         (if (Alloy42 `elem` modes)
-          then if (hasNoReals)
+          then if (hasNoRealLiterals && hasNoReferenceToReal && hasNoProductOperator)
                 then
                    let
                       (imod,strMap) = astrModule iModule
@@ -564,7 +542,11 @@
                       ]
                 else [ (Alloy,
                         NoCompilerResult {
-                         reason = "Alloy output unavailable because the model contains real numbers."
+                         reason = "Alloy output unavailable because the model contains: "
+                                ++ (if hasNoRealLiterals then "" else " | a real number literal")
+                                ++ (if hasNoReferenceToReal then "" else " | a reference to a real")
+                                ++ (if hasNoProductOperator then "" else " | the product operator")
+                                ++ "."
                         })
                      ]
           else []
@@ -641,31 +623,28 @@
         ++ (if (Python `elem` modes)
           then [ (Python,
                   CompilerResult {
-                   extension = "py",
-                   outputCode = genPythonModule iModule,
-                   statistics = stats,
-                   claferEnv  = env,
-                   mappingToAlloy = [],
-                   stringMap = Map.empty,
-                   scopesList = scopes
+                    extension = "py",
+                    outputCode = genPythonModule (iModule, genv) scopes,
+                    statistics = stats,
+                    claferEnv  = env,
+                    mappingToAlloy = [],
+                    stringMap = Map.empty,
+                    scopesList = scopes
                   }) ]
           else []
         )
         -- result for Choco
         ++ (if (Choco `elem` modes)
-          then let
-                  imod = iModule
-               in
-                  [ (Choco,
-                     CompilerResult {
-                         extension = "js",
-                         outputCode = genCModule cargs (imod, genv) scopes,
-                         statistics = stats,
-                         claferEnv  = env,
-                         mappingToAlloy = [],
-                         stringMap = Map.empty,
-                         scopesList = scopes
-                      }) ]
+          then [ (Choco,
+                  CompilerResult {
+                    extension = "js",
+                    outputCode = genCModule (iModule, genv) scopes,
+                    statistics = stats,
+                    claferEnv  = env,
+                    mappingToAlloy = [],
+                    stringMap = Map.empty,
+                    scopesList = scopes
+                   }) ]
           else []
         ))
 
@@ -707,11 +686,11 @@
 
 showStats :: Bool -> Stats -> String
 showStats au (Stats na nr nc nconst ngoals sgl) =
-  unlines [ "All clafers: " ++ (show (na + nc)) ++ " | Abstract: " ++ (show na) ++ " | Concrete: " ++ (show nc) ++ " | References: " ++ (show nr)
+  unlines [ "All clafers: " ++ (show (na + nc)) ++ " | Abstract: " ++ (show na) ++ " | Concrete: " ++ (show nc) ++ " | Reference: " ++ (show nr)
           , "Constraints: " ++ show nconst
           , "Goals: " ++ show ngoals
           , "Global scope: " ++ showInterval sgl
-          , "Can skip resolver: " ++ if au then "yes" else "no" ]
+          , "Can skip name resolver: " ++ if au then "yes" else "no" ]
 
 showInterval :: (Integer, Integer) -> String
 showInterval (n, -1) = show n ++ "..*"
diff --git a/src/Language/Clafer/ClaferArgs.hs b/src/Language/Clafer/ClaferArgs.hs
--- a/src/Language/Clafer/ClaferArgs.hs
+++ b/src/Language/Clafer/ClaferArgs.hs
@@ -41,10 +41,10 @@
 data ClaferMode = Alloy42 | Alloy | Xml | Clafer | Html | Graph | CVLGraph | Python | Choco
   deriving (Eq, Show, Ord, Data, Typeable)
 instance Default ClaferMode where
-  def = Alloy
+  def = Alloy42
 
 -- | Scope inference strategy
-data ScopeStrategy = None | Simple | Full
+data ScopeStrategy = None | Simple
   deriving (Eq, Show, Data, Typeable)
 instance Default ScopeStrategy where
   def = Simple
@@ -99,7 +99,7 @@
   show_references     = def &= help "Whether the links for references should be rendered. ('html' and 'graph' modes only)." &= name "sr",
   add_comments        = def &= help "Include comments from the source file in the html output ('html' mode only).",
   ecore2clafer        = def &= help "Translate an ECore model into Clafer.",
-  scope_strategy      = def &= help "Use scope computation strategy: none, simple (default), or full." &= name "ss",
+  scope_strategy      = def &= help "Use scope computation strategy: none or simple (default)." &= name "ss",
   afm                 = def &= help "Throws an error if the cardinality of any of the clafers is above 1." &= name "check-afm",
   skip_goals          = def &= help "Skip generation of Alloy code for goals. Useful for all tools working with standard Alloy." &= name "sg",
   meta_data           = def &= help "Generate a 'fully qualified name'-'least-partially-qualified name'-'unique ID' map ('.cfr-map'). In Alloy, Alloy42, and Choco modes, generate the scopes map ('.cfr-scope').",
diff --git a/src/Language/Clafer/Comments.hs b/src/Language/Clafer/Comments.hs
--- a/src/Language/Clafer/Comments.hs
+++ b/src/Language/Clafer/Comments.hs
@@ -24,7 +24,7 @@
 
 import Data.Maybe (fromMaybe)
 import Data.List (stripPrefix)
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 
 type InputModel = String
 
diff --git a/src/Language/Clafer/Common.hs b/src/Language/Clafer/Common.hs
--- a/src/Language/Clafer/Common.hs
+++ b/src/Language/Clafer/Common.hs
@@ -33,7 +33,7 @@
 import qualified Data.StringMap as SMap
 import           Data.Tree
 
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Intclafer
 
 -- -----------------------------------------------------------------------------
@@ -70,14 +70,12 @@
 
 getSuperId :: PExp -> String
 getSuperId (PExp _ _ _ (IClaferId{ _sident = s})) = s
+getSuperId (PExp _ _ _ (IFunExp{_op=".", _exps = [_, rightExp]})) = getSuperId rightExp
 getSuperId pexp' = error $ "Bug: getSuperId called not on '[PExp (IClaferId)]' but instead on '" ++ show pexp' ++ "'"
 
 isEqClaferId :: String -> IClafer -> Bool
 isEqClaferId    uid'      claf'    = _uid claf' == uid'
 
-idToPExp :: String -> Span -> String -> String -> Bool -> PExp
-idToPExp pid' pos modids id' isTop' = PExp (Just $ TClafer [id']) pid' pos (IClaferId modids id' isTop' Nothing)
-
 mkPLClaferId :: CName -> Bool -> ClaferBinding -> PExp
 mkPLClaferId id' isTop' bind' = pExpDefPidPos $ IClaferId "" id' isTop' bind'
 
@@ -108,8 +106,8 @@
 getClaferName _ = ""
 
 isTopLevel :: IClafer -> Bool
-isTopLevel IClafer{_parentUID=puid} = puid == rootIdent  -- for concrete clafers
-                                   || puid == baseClafer -- for abstract clafers
+isTopLevel IClafer{_parentUID="root"} = True
+isTopLevel _                          = False
 
 -- -----------------------------------------------------------------------------
 -- conversions
@@ -121,43 +119,185 @@
 toClafers :: [IElement] -> [IClafer]
 toClafers = mapMaybe elemToClafer
 
+
 -- -----------------------------------------------------------------------------
--- finds hierarchy and transforms each element
+-- UID -> IClafer map construction functions
+
+type UIDIClaferMap = StringMap IClafer
+
+createUidIClaferMap :: IModule -> UIDIClaferMap
+createUidIClaferMap    iModule  = foldl'
+    (\accumMap' claf -> SMap.insert (_uid claf) claf accumMap')
+    (SMap.singleton rootIdent rootClafer)
+    (integerClafer : intClafer : stringClafer : realClafer : booleanClafer : clafer : allClafers)
+  where
+    allClafers :: [ IClafer ]
+    allClafers = universeOn biplate iModule
+    rootClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) rootIdent rootIdent "" Nothing Nothing (Just (1,1)) (1, 1) (_mDecls iModule)
+    integerClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) integerType integerType "" Nothing Nothing (Just (1,1)) (1, 1) []
+    intClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) "int" "int" "" Nothing Nothing (Just (1,1)) (1, 1) []
+    stringClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) stringType stringType "" Nothing Nothing (Just (1,1)) (1, 1) []
+    realClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) realType realType "" Nothing Nothing (Just (1,1)) (1, 1) []
+    booleanClafer = IClafer noSpan False (Just $ IGCard False (0, -1)) booleanType booleanType "" Nothing Nothing (Just (1,1)) (1, 1) []
+    clafer = IClafer noSpan False (Just $ IGCard False (0, -1)) baseClafer baseClafer "" Nothing Nothing (Just (1,1)) (1, 1) []
+
+-- -----------------------------------------------------------------------------
+-- functions using the UID -> IClafer map
+
+findIClafer :: UIDIClaferMap -> UID -> Maybe IClafer
+findIClafer    uidIClaferMap    uid' = SMap.lookup uid' uidIClaferMap
+
+-- | Finds all super clafers according to sFun
+findHierarchy :: (IClafer -> [String]) -> UIDIClaferMap -> IClafer -> [IClafer]
+findHierarchy    sFun                     uidIClaferMap    clafer   = case sFun clafer of
+  []           -> [clafer]  -- no super and no reference
+  supersOrRefs -> let
+                    superOrRefClafers = mapMaybe (findIClafer uidIClaferMap) supersOrRefs
+                  in
+                    clafer
+                    : concatMap (findHierarchy sFun uidIClaferMap) superOrRefClafers
+
+-- | Finds hierarchy and transforms each element
 mapHierarchy :: (IClafer -> b)
                 -> (IClafer -> [String])
-                -> [IClafer]
+                -> UIDIClaferMap
                 -> IClafer
                 -> [b]
 mapHierarchy f sf = (map f.).(findHierarchy sf)
 
+-- | traverse the inheritance hierarchy upwards to find a clafer with the given uidToFind
+findUIDinSupers :: UIDIClaferMap -> UID    -> IClafer      -> Maybe IClafer
+findUIDinSupers    uidIClaferMap    uidToFind currentClafer =
+  if uidToFind == _uid currentClafer
+  then return currentClafer
+  else do
+    superClaferUID <- getSuperId <$> _super currentClafer
+    superClafer <- findIClafer uidIClaferMap superClaferUID
+    findUIDinSupers uidIClaferMap uidToFind superClafer
 
--- returns inheritance hierarchy of a clafer
+-- | traverse the containment hierarchy upwards to find a clafer with the given uidToFind
+findUIDinParents :: UIDIClaferMap -> UID    -> IClafer      -> Maybe IClafer
+findUIDinParents    uidIClaferMap    uidToFind currentClafer =
+  if uidToFind == _uid currentClafer
+  then return currentClafer
+  else do
+    parentClafer <- findIClafer uidIClaferMap $ _parentUID currentClafer
+    findUIDinParents uidIClaferMap uidToFind parentClafer
 
-findHierarchy :: (IClafer -> [String])
-                            -> [IClafer]
-                            -> IClafer
-                            -> [IClafer]
-findHierarchy sFun clafers clafer = case sFun clafer of
-  []           -> [clafer]  -- no super and no reference
-  supersOrRefs -> let
-                    superOrRefClafers = (concatMap findSuper supersOrRefs)
-                  in
-                    clafer : superOrRefClafers ++ concatMap (findHierarchy sFun clafers) superOrRefClafers
-  where
-    findSuper superUid = filter (\c -> _uid c == superUid) clafers
+data NestedInheritanceMatch
+  = NestedInheritanceMatch
+  { _headClafer :: IClafer               -- ^ the clafer for which the match is computed
+  , _parentClafer :: IClafer             -- ^ parent of the head clafer
+  , _parentsSuperClafer :: Maybe IClafer -- ^ parent of the super of the head clafer
+  , _targetClafer :: Maybe IClafer       -- ^ target of the head clafer
+  , _targetsSuperClafer :: Maybe IClafer -- ^ super of the target of the head clafer
+  , _superClafer :: IClafer              -- ^ super of the head clafer (must exist, otherwise no match)
+  , _superClafersParent :: IClafer       -- ^ parent of the super of the head clafer
+  , _superClafersTarget :: Maybe IClafer -- ^ target of the super of the head clafer
+  } deriving Show
 
--- -----------------------------------------------------------------------------
--- map construction functions
+-- | This represents a match of this shape
+--
+--    superClafersParent
+--         /\           <>
+--        ?1|             \*
+-- parentsSuperClafer      \
+--         /\    [=]   superClafer --*-> superClafersTarget
+--         *|              /\                     /\
+--    parentClafer          |                      |?2
+--               <>        *|       [=]   targetsSuperClafer
+--                *\        |                     /\
+--                  \       |                     *|
+--                   headClafer -----*-----> targetClafer
+--
+-- The clafers are obtained by navigating from the headClafer
+-- by following the links marked by *
+-- The link marked by ?1 is checked for correctness of nesting (isProperNesting):
+-- - _uid parentsSuperClafer == _parentUID superClafer
+-- The link marked by ?2 is checked for correctness of redefinition (isProperRefinement):
+-- - proper subtyping, bag to set, proper cardinality restriction
+-- Redefinition occurs when the name of headClafer is the same as the name of superClafer (isProperRedefinition):
+-- - isProperNesting && isProperRefinement && (_ident headClafer) == (_ident superClafer)
 
-createUidIClaferMap :: IModule -> StringMap IClafer
-createUidIClaferMap    iModule  = foldl' (\accumMap' claf -> SMap.insert (_uid claf) claf accumMap') SMap.empty allClafers
+isProperNesting :: UIDIClaferMap -> Maybe NestedInheritanceMatch -> Bool
+isProperNesting _ Nothing  = True
+isProperNesting uidIClaferMap (Just m) = if (isTopLevel $ _superClafer m) && (_isAbstract $ _superClafer m)
+  then True
+  else case (_parentsSuperClafer m) of
+    Nothing                 -> (_uid $ _parentClafer m) == (_uid $ _superClafersParent m)
+    Just parentsSuperClafer -> isJust $  findUIDinSupers uidIClaferMap (_parentUID $ _superClafer m) parentsSuperClafer
+
+-- ^ assumes that isProperNesting m == True
+isProperRefinement :: UIDIClaferMap -> Maybe NestedInheritanceMatch
+  -> (Bool,  Bool,  Bool)
+isProperRefinement    _                Nothing
+  = ( True
+    , True
+    , True )
+isProperRefinement    uidIClaferMap    (Just m)
+  = ( properCardinalityRefinement m
+    , properBagToSetRefinement m
+    , properTargetSubtyping m )
   where
-    allClafers :: [ IClafer ]
-    allClafers = universeOn biplate iModule
+    properCardinalityRefinement NestedInheritanceMatch{_headClafer=hc, _superClafer=hcs}
+      = case (_card hc, _card hcs) of
+          (Just (hcl, hcu), Just (hcsl, hcsu)) -> hcl >= hcsl && (hcu <= hcsu || hcsu == -1)
+          _ -> True
+    properBagToSetRefinement NestedInheritanceMatch{_headClafer=hc, _superClafer=hcs}
+      = case (_reference hc, _reference hcs) of
+          (Just IReference{_isSet=headIsSet}, Just IReference{_isSet=superIsSet}) -> superIsSet <= headIsSet  -- set (True) implies set (True), bag (False) allows bag (False) or set (True)
+          _ -> True -- covers 1) only one of them has a ref, and 2) none of them has a ref
+    properTargetSubtyping NestedInheritanceMatch{_targetClafer=(Just targetClafer), _superClafersTarget=(Just superClafersTarget)}
+      = isJust $ findUIDinSupers uidIClaferMap (_uid superClafersTarget) targetClafer
+    properTargetSubtyping _
+      = True -- covers 1) only one of the target clafers exists, and 2) none of the target clafers exist
 
-findIClafer :: StringMap IClafer -> UID -> Maybe IClafer
-findIClafer    uidIClaferMap        uid' = SMap.lookup uid' uidIClaferMap
+-- ^ assumes that isProperNesting m == True and isProperRefinement m == (True, True, True)
+isRedefinition :: Maybe NestedInheritanceMatch -> Bool -- ^ whether the name of headClafer is the same as superClafer
+isRedefinition Nothing = True
+isRedefinition (Just NestedInheritanceMatch{_headClafer=hc, _superClafer=hs})
+  =  (_ident hc) == (_ident hs)
 
+
+
+-- ^ try to match the nested inheritance pattern
+-- ^ only available after the parentUIDs were computed
+matchNestedInheritance :: UIDIClaferMap -> IClafer
+  -> Maybe NestedInheritanceMatch
+matchNestedInheritance    _                    IClafer{_super=Nothing}    = Nothing
+matchNestedInheritance    uidIClaferMap        headClafer                 = do
+--  traceM $ "matching nested inheritance for " ++ _uid headClafer
+  parentClafer       <- findIClafer uidIClaferMap $ _parentUID headClafer
+--  traceM $ "matched parentClafer " ++ _uid parentClafer
+  superClafer        <- (findIClafer uidIClaferMap) =<< (getSuperId <$> _super headClafer)
+--  traceM $ "matched superClafer " ++ _uid superClafer
+  superClafersParent <- findIClafer uidIClaferMap $ _parentUID superClafer
+--  traceM $ "matched superClafersParent " ++ _uid superClafersParent
+  let
+    parentsSuperClafer :: Maybe IClafer
+    parentsSuperClafer = findIClafer uidIClaferMap =<< getSuperId <$> _super parentClafer  -- safe to use fromJust becuase _super is not isNothing
+    targetClafer :: Maybe IClafer
+    targetClafer = findIClafer uidIClaferMap =<< getSuperId <$> _ref <$> _reference headClafer
+    targetsSuperClafer :: Maybe IClafer
+    targetsSuperClafer = findIClafer uidIClaferMap =<< getSuperId <$> (_super =<< targetClafer)
+    superClafersTarget :: Maybe IClafer
+    superClafersTarget = findIClafer uidIClaferMap =<< getSuperId <$> _ref <$> _reference superClafer
+--  traceM $ "matched parentsSuperClafer " ++ show (_uid <$> parentsSuperClafer)
+--  traceM $ "matched targetClafer " ++ show (_uid <$> targetClafer)
+--  traceM $ "matched targetsSuperClafer " ++ show (_uid <$> targetsSuperClafer)
+--  traceM $ "matched superClafersTarget " ++ show (_uid <$> superClafersTarget)
+  return $ NestedInheritanceMatch
+    { _headClafer = headClafer
+    , _parentClafer = parentClafer
+    , _parentsSuperClafer = parentsSuperClafer
+    , _superClafer = superClafer
+    , _superClafersParent = superClafersParent
+    , _targetClafer = targetClafer
+    , _targetsSuperClafer = targetsSuperClafer
+    , _superClafersTarget = superClafersTarget
+    }
+
+
 -- -----------------------------------------------------------------------------
 -- generic functions
 
@@ -217,8 +357,11 @@
 iSumSet :: String
 iSumSet       = "sum"
 
+iProdSet :: String
+iProdSet      = "product"
+
 unOps :: [String]
-unOps = [iNot, iCSet, iMin, iGMax, iGMin, iSumSet]
+unOps = [iNot, iCSet, iMin, iGMax, iGMin, iSumSet, iProdSet]
 
 -- binary operators
 iIff :: String
@@ -284,11 +427,14 @@
 iDiv :: String
 iDiv          = "/"
 
+iRem :: String
+iRem          = "%"
+
 iSumSet' :: String
 iSumSet'      = "sum'"
 
 arithBinOps :: [String]
-arithBinOps = [iPlus, iSub, iMul, iDiv, iSumSet']
+arithBinOps = [iPlus, iSub, iMul, iDiv, iRem, iSumSet']
 
 iUnion :: String
 iUnion        = "++"
@@ -297,7 +443,7 @@
 iDifference   = "--"
 
 iIntersection :: String
-iIntersection = "&"
+iIntersection = "**"
 
 iDomain :: String
 iDomain       = "<:"
@@ -320,7 +466,7 @@
 
 mkIFunExp :: String -> [IExp] -> IExp
 mkIFunExp _ (x:[]) = x
-mkIFunExp op' xs = foldl1 (\x y -> IFunExp op' $ map (PExp (Just $ TClafer []) "" noSpan) [x,y]) xs
+mkIFunExp op' xs = foldl1 (\x y -> IFunExp op' $ map (PExp Nothing "" noSpan) [x,y]) xs
 
 toLowerS :: String -> String
 toLowerS "" = ""
@@ -386,18 +532,20 @@
   baseClafer :
   specialNames ++
   primitiveTypes ++
-  [ iGMax, iGMin, iSumSet ] ++ -- unary operators
+  [ iGMax, iGMin, iSumSet, iProdSet ] ++ -- unary operators
   [ iXor, iIn ] ++ -- binary operators
   [ "if", "then", "else" ] ++ -- ternary operators
   [ "no", "not", "some", "one", "all", "disj" ] ++ -- quantifiers
   [ "opt", "mux", "or", "lone" ] ++ -- group cardinalities
   [ "abstract", "enum" ] -- keywords
 
-data GEnv = GEnv {
-  identCountMap :: Map.Map String Int,
-  expCount :: Int,
-  stable :: Map.Map UID [[UID]], -- super clafer names of a given clafer
-  sClafers ::[IClafer] -- all clafers (no going through references)
+data GEnv
+  = GEnv
+  { identCountMap :: Map.Map String Int
+  , expCount :: Int
+  , stable :: Map.Map UID [[UID]] -- super clafer names of a given clafer
+  , sClafers ::[IClafer]          -- all clafers (no going through references)
+  , uidClaferMap :: UIDIClaferMap -- the map needs to be re-created everytime IModule is rewritten
   } deriving (Eq, Show)
 
 voidf :: Monad m => m t -> m ()
diff --git a/src/Language/Clafer/Front/AbsClafer.hs b/src/Language/Clafer/Front/AbsClafer.hs
new file mode 100644
--- /dev/null
+++ b/src/Language/Clafer/Front/AbsClafer.hs
@@ -0,0 +1,325 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+module Language.Clafer.Front.AbsClafer where
+
+-- Haskell module generated by the BNF converter
+
+
+import Data.Data (Data,Typeable)
+import GHC.Generics (Generic)
+data Pos = Pos Integer Integer deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+noPos :: Pos
+noPos = Pos 0 0
+
+data Span = Span Pos Pos deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+noSpan :: Span
+noSpan = Span noPos noPos
+
+class Spannable n where getSpan :: n -> Span
+
+instance Spannable n => Spannable [n] where
+  getSpan (x:xs) = foldr (\item acc -> getSpan item >- acc ) (getSpan x) xs
+  getSpan [] = noSpan
+
+(>-) :: Span -> Span -> Span
+(>-) (Span (Pos 0 0) (Pos 0 0)) s = s
+(>-) r (Span (Pos 0 0) (Pos 0 0)) = r
+(>-) (Span m _) (Span _ p) = Span m p
+
+len :: [a] -> Integer
+len = toInteger . length
+newtype PosInteger = PosInteger ((Int,Int),String)
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+newtype PosDouble = PosDouble ((Int,Int),String)
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+newtype PosString = PosString ((Int,Int),String)
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+newtype PosIdent = PosIdent ((Int,Int),String)
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+instance Spannable PosInteger where
+  getSpan (PosInteger ((c, l), lex')) = 
+    Span (Pos c' l') (Pos c' $ l' + len lex')
+    where
+      c' = toInteger c
+      l' = toInteger l
+instance Spannable PosDouble where
+  getSpan (PosDouble ((c, l), lex')) = 
+    Span (Pos c' l') (Pos c' $ l' + len lex')
+    where
+      c' = toInteger c
+      l' = toInteger l
+instance Spannable PosString where
+  getSpan (PosString ((c, l), lex')) = 
+    Span (Pos c' l') (Pos c' $ l' + len lex')
+    where
+      c' = toInteger c
+      l' = toInteger l
+instance Spannable PosIdent where
+  getSpan (PosIdent ((c, l), lex')) = 
+    Span (Pos c' l') (Pos c' $ l' + len lex')
+    where
+      c' = toInteger c
+      l' = toInteger l
+data Module = Module Span [Declaration]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Module where
+    getSpan (Module s _ ) = s
+data Declaration
+    = EnumDecl Span PosIdent [EnumId] | ElementDecl Span Element
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Declaration where
+    getSpan (EnumDecl s _ _ ) = s
+    getSpan (ElementDecl s _ ) = s
+data Clafer
+    = Clafer Span Abstract GCard PosIdent Super Reference Card Init Elements
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Clafer where
+    getSpan (Clafer s _ _ _ _ _ _ _ _ ) = s
+data Constraint = Constraint Span [Exp]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Constraint where
+    getSpan (Constraint s _ ) = s
+data SoftConstraint = SoftConstraint Span [Exp]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable SoftConstraint where
+    getSpan (SoftConstraint s _ ) = s
+data Goal = Goal Span [Exp]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Goal where
+    getSpan (Goal s _ ) = s
+data Abstract = AbstractEmpty Span | Abstract Span
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Abstract where
+    getSpan (AbstractEmpty s ) = s
+    getSpan (Abstract s ) = s
+data Elements = ElementsEmpty Span | ElementsList Span [Element]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Elements where
+    getSpan (ElementsEmpty s ) = s
+    getSpan (ElementsList s _ ) = s
+data Element
+    = Subclafer Span Clafer
+    | ClaferUse Span Name Card Elements
+    | Subconstraint Span Constraint
+    | Subgoal Span Goal
+    | Subsoftconstraint Span SoftConstraint
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Element where
+    getSpan (Subclafer s _ ) = s
+    getSpan (ClaferUse s _ _ _ ) = s
+    getSpan (Subconstraint s _ ) = s
+    getSpan (Subgoal s _ ) = s
+    getSpan (Subsoftconstraint s _ ) = s
+data Super = SuperEmpty Span | SuperSome Span SetExp
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Super where
+    getSpan (SuperEmpty s ) = s
+    getSpan (SuperSome s _ ) = s
+data Reference
+    = ReferenceEmpty Span
+    | ReferenceSet Span SetExp
+    | ReferenceBag Span SetExp
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Reference where
+    getSpan (ReferenceEmpty s ) = s
+    getSpan (ReferenceSet s _ ) = s
+    getSpan (ReferenceBag s _ ) = s
+data Init = InitEmpty Span | InitSome Span InitHow Exp
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Init where
+    getSpan (InitEmpty s ) = s
+    getSpan (InitSome s _ _ ) = s
+data InitHow = InitConstant Span | InitDefault Span
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable InitHow where
+    getSpan (InitConstant s ) = s
+    getSpan (InitDefault s ) = s
+data GCard
+    = GCardEmpty Span
+    | GCardXor Span
+    | GCardOr Span
+    | GCardMux Span
+    | GCardOpt Span
+    | GCardInterval Span NCard
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable GCard where
+    getSpan (GCardEmpty s ) = s
+    getSpan (GCardXor s ) = s
+    getSpan (GCardOr s ) = s
+    getSpan (GCardMux s ) = s
+    getSpan (GCardOpt s ) = s
+    getSpan (GCardInterval s _ ) = s
+data Card
+    = CardEmpty Span
+    | CardLone Span
+    | CardSome Span
+    | CardAny Span
+    | CardNum Span PosInteger
+    | CardInterval Span NCard
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Card where
+    getSpan (CardEmpty s ) = s
+    getSpan (CardLone s ) = s
+    getSpan (CardSome s ) = s
+    getSpan (CardAny s ) = s
+    getSpan (CardNum s _ ) = s
+    getSpan (CardInterval s _ ) = s
+data NCard = NCard Span PosInteger ExInteger
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable NCard where
+    getSpan (NCard s _ _ ) = s
+data ExInteger = ExIntegerAst Span | ExIntegerNum Span PosInteger
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable ExInteger where
+    getSpan (ExIntegerAst s ) = s
+    getSpan (ExIntegerNum s _ ) = s
+data Name = Path Span [ModId]
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Name where
+    getSpan (Path s _ ) = s
+data Exp
+    = DeclAllDisj Span Decl Exp
+    | DeclAll Span Decl Exp
+    | DeclQuantDisj Span Quant Decl Exp
+    | DeclQuant Span Quant Decl Exp
+    | EGMax Span Exp
+    | EGMin Span Exp
+    | EIff Span Exp Exp
+    | EImplies Span Exp Exp
+    | EOr Span Exp Exp
+    | EXor Span Exp Exp
+    | EAnd Span Exp Exp
+    | ENeg Span Exp
+    | ELt Span Exp Exp
+    | EGt Span Exp Exp
+    | EEq Span Exp Exp
+    | ELte Span Exp Exp
+    | EGte Span Exp Exp
+    | ENeq Span Exp Exp
+    | EIn Span Exp Exp
+    | ENin Span Exp Exp
+    | QuantExp Span Quant Exp
+    | EAdd Span Exp Exp
+    | ESub Span Exp Exp
+    | EMul Span Exp Exp
+    | EDiv Span Exp Exp
+    | ERem Span Exp Exp
+    | ESumSetExp Span Exp
+    | EProdSetExp Span Exp
+    | ECSetExp Span Exp
+    | EMinExp Span Exp
+    | EImpliesElse Span Exp Exp Exp
+    | EInt Span PosInteger
+    | EDouble Span PosDouble
+    | EStr Span PosString
+    | ESetExp Span SetExp
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Exp where
+    getSpan (DeclAllDisj s _ _ ) = s
+    getSpan (DeclAll s _ _ ) = s
+    getSpan (DeclQuantDisj s _ _ _ ) = s
+    getSpan (DeclQuant s _ _ _ ) = s
+    getSpan (EGMax s _ ) = s
+    getSpan (EGMin s _ ) = s
+    getSpan (EIff s _ _ ) = s
+    getSpan (EImplies s _ _ ) = s
+    getSpan (EOr s _ _ ) = s
+    getSpan (EXor s _ _ ) = s
+    getSpan (EAnd s _ _ ) = s
+    getSpan (ENeg s _ ) = s
+    getSpan (ELt s _ _ ) = s
+    getSpan (EGt s _ _ ) = s
+    getSpan (EEq s _ _ ) = s
+    getSpan (ELte s _ _ ) = s
+    getSpan (EGte s _ _ ) = s
+    getSpan (ENeq s _ _ ) = s
+    getSpan (EIn s _ _ ) = s
+    getSpan (ENin s _ _ ) = s
+    getSpan (QuantExp s _ _ ) = s
+    getSpan (EAdd s _ _ ) = s
+    getSpan (ESub s _ _ ) = s
+    getSpan (EMul s _ _ ) = s
+    getSpan (EDiv s _ _ ) = s
+    getSpan (ERem s _ _ ) = s
+    getSpan (ESumSetExp s _ ) = s
+    getSpan (EProdSetExp s _ ) = s
+    getSpan (ECSetExp s _ ) = s
+    getSpan (EMinExp s _ ) = s
+    getSpan (EImpliesElse s _ _ _ ) = s
+    getSpan (EInt s _ ) = s
+    getSpan (EDouble s _ ) = s
+    getSpan (EStr s _ ) = s
+    getSpan (ESetExp s _ ) = s
+data SetExp
+    = Union Span SetExp SetExp
+    | UnionCom Span SetExp SetExp
+    | Difference Span SetExp SetExp
+    | Intersection Span SetExp SetExp
+    | Domain Span SetExp SetExp
+    | Range Span SetExp SetExp
+    | Join Span SetExp SetExp
+    | ClaferId Span Name
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable SetExp where
+    getSpan (Union s _ _ ) = s
+    getSpan (UnionCom s _ _ ) = s
+    getSpan (Difference s _ _ ) = s
+    getSpan (Intersection s _ _ ) = s
+    getSpan (Domain s _ _ ) = s
+    getSpan (Range s _ _ ) = s
+    getSpan (Join s _ _ ) = s
+    getSpan (ClaferId s _ ) = s
+data Decl = Decl Span [LocId] SetExp
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Decl where
+    getSpan (Decl s _ _ ) = s
+data Quant
+    = QuantNo Span
+    | QuantNot Span
+    | QuantLone Span
+    | QuantOne Span
+    | QuantSome Span
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable Quant where
+    getSpan (QuantNo s ) = s
+    getSpan (QuantNot s ) = s
+    getSpan (QuantLone s ) = s
+    getSpan (QuantOne s ) = s
+    getSpan (QuantSome s ) = s
+data EnumId = EnumIdIdent Span PosIdent
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable EnumId where
+    getSpan (EnumIdIdent s _ ) = s
+data ModId = ModIdIdent Span PosIdent
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable ModId where
+    getSpan (ModIdIdent s _ ) = s
+data LocId = LocIdIdent Span PosIdent
+  deriving (Eq, Ord, Show, Read, Data, Typeable, Generic)
+
+instance Spannable LocId where
+    getSpan (LocIdIdent s _ ) = s
diff --git a/src/Language/Clafer/Front/Absclafer.hs b/src/Language/Clafer/Front/Absclafer.hs
deleted file mode 100644
--- a/src/Language/Clafer/Front/Absclafer.hs
+++ /dev/null
@@ -1,371 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE DeriveGeneric #-}
-module Language.Clafer.Front.Absclafer where
-
--- Haskell module generated by the BNF converter
-
-
-import Data.Data (Data,Typeable)
-import GHC.Generics (Generic)
-data Pos = Pos Integer Integer  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-noPos :: Pos
-noPos = Pos 0 0
-
-data Span = Span Pos Pos deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-noSpan :: Span
-noSpan = Span noPos noPos
-
-class Spannable n where
-  getSpan :: n -> Span
-
-instance Spannable n => Spannable [n] where
-  getSpan (x:xs) = foldr (\item acc -> getSpan item >- acc ) (getSpan x) xs
-  getSpan [] = noSpan
-
-(>-) :: Span -> Span -> Span
-(>-) (Span (Pos 0 0) (Pos 0 0)) s = s
-(>-) r (Span (Pos 0 0) (Pos 0 0)) = r
-(>-) (Span m _) (Span _ p) = Span m p
-
-len :: [a] -> Integer
-len = toInteger . length
-
-newtype PosInteger = PosInteger ((Int,Int),String) deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-newtype PosDouble = PosDouble ((Int,Int),String) deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-newtype PosString = PosString ((Int,Int),String) deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-newtype PosIdent = PosIdent ((Int,Int),String) deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-data Module =
-   Module Span [Declaration]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Declaration =
-   EnumDecl Span PosIdent [EnumId]
- | ElementDecl Span Element
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Clafer =
-   Clafer Span Abstract GCard PosIdent Super Reference Card Init Elements
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Constraint =
-   Constraint Span [Exp]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data SoftConstraint =
-   SoftConstraint Span [Exp]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Goal =
-   Goal Span [Exp]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Abstract =
-   AbstractEmpty Span
- | Abstract Span
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Elements =
-   ElementsEmpty Span
- | ElementsList Span [Element]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Element =
-   Subclafer Span Clafer
- | ClaferUse Span Name Card Elements
- | Subconstraint Span Constraint
- | Subgoal Span Goal
- | Subsoftconstraint Span SoftConstraint
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Super =
-   SuperEmpty Span
- | SuperSome Span SetExp
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Reference =
-   ReferenceEmpty Span
- | ReferenceSet Span SetExp
- | ReferenceBag Span SetExp
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Init =
-   InitEmpty Span
- | InitSome Span InitHow Exp
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data InitHow =
-   InitConstant Span
- | InitDefault Span
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data GCard =
-   GCardEmpty Span
- | GCardXor Span
- | GCardOr Span
- | GCardMux Span
- | GCardOpt Span
- | GCardInterval Span NCard
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Card =
-   CardEmpty Span
- | CardLone Span
- | CardSome Span
- | CardAny Span
- | CardNum Span PosInteger
- | CardInterval Span NCard
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data NCard =
-   NCard Span PosInteger ExInteger
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data ExInteger =
-   ExIntegerAst Span
- | ExIntegerNum Span PosInteger
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Name =
-   Path Span [ModId]
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Exp =
-   DeclAllDisj Span Decl Exp
- | DeclAll Span Decl Exp
- | DeclQuantDisj Span Quant Decl Exp
- | DeclQuant Span Quant Decl Exp
- | EGMax Span Exp
- | EGMin Span Exp
- | EIff Span Exp Exp
- | EImplies Span Exp Exp
- | EOr Span Exp Exp
- | EXor Span Exp Exp
- | EAnd Span Exp Exp
- | ENeg Span Exp
- | ELt Span Exp Exp
- | EGt Span Exp Exp
- | EEq Span Exp Exp
- | ELte Span Exp Exp
- | EGte Span Exp Exp
- | ENeq Span Exp Exp
- | EIn Span Exp Exp
- | ENin Span Exp Exp
- | QuantExp Span Quant Exp
- | EAdd Span Exp Exp
- | ESub Span Exp Exp
- | EMul Span Exp Exp
- | EDiv Span Exp Exp
- | ESumSetExp Span Exp
- | ECSetExp Span Exp
- | EMinExp Span Exp
- | EImpliesElse Span Exp Exp Exp
- | EInt Span PosInteger
- | EDouble Span PosDouble
- | EStr Span PosString
- | ESetExp Span SetExp
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data SetExp =
-   Union Span SetExp SetExp
- | UnionCom Span SetExp SetExp
- | Difference Span SetExp SetExp
- | Intersection Span SetExp SetExp
- | Domain Span SetExp SetExp
- | Range Span SetExp SetExp
- | Join Span SetExp SetExp
- | ClaferId Span Name
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Decl =
-   Decl Span [LocId] SetExp
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data Quant =
-   QuantNo Span
- | QuantNot Span
- | QuantLone Span
- | QuantOne Span
- | QuantSome Span
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data EnumId =
-   EnumIdIdent Span PosIdent
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data ModId =
-   ModIdIdent Span PosIdent
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-data LocId =
-   LocIdIdent Span PosIdent
-  deriving (Eq,Ord,Show,Read,Data,Typeable,Generic)
-
-instance Spannable Module where
-  getSpan ( Module s _ ) = s
-
-instance Spannable Declaration where
-  getSpan ( EnumDecl s _ _ ) = s
-  getSpan ( ElementDecl s _ ) = s
-
-instance Spannable Clafer where
-  getSpan ( Clafer s _ _ _ _ _ _ _ _ ) = s
-
-instance Spannable Constraint where
-  getSpan ( Constraint s _ ) = s
-
-instance Spannable SoftConstraint where
-  getSpan ( SoftConstraint s _ ) = s
-
-instance Spannable Goal where
-  getSpan ( Goal s _ ) = s
-
-instance Spannable Abstract where
-  getSpan ( AbstractEmpty s ) = s
-  getSpan ( Abstract s ) = s
-
-instance Spannable Elements where
-  getSpan ( ElementsEmpty s ) = s
-  getSpan ( ElementsList s _ ) = s
-
-instance Spannable Element where
-  getSpan ( Subclafer s _ ) = s
-  getSpan ( ClaferUse s _ _ _ ) = s
-  getSpan ( Subconstraint s _ ) = s
-  getSpan ( Subgoal s _ ) = s
-  getSpan ( Subsoftconstraint s _ ) = s
-
-instance Spannable Super where
-  getSpan ( SuperEmpty s ) = s
-  getSpan ( SuperSome s _ ) = s
-
-instance Spannable Reference where
-  getSpan ( ReferenceEmpty s ) = s
-  getSpan ( ReferenceSet s _ ) = s
-  getSpan ( ReferenceBag s _ ) = s
-
-instance Spannable Init where
-  getSpan ( InitEmpty s ) = s
-  getSpan ( InitSome s _ _ ) = s
-
-instance Spannable InitHow where
-  getSpan ( InitConstant s ) = s
-  getSpan ( InitDefault s ) = s
-
-instance Spannable GCard where
-  getSpan ( GCardEmpty s ) = s
-  getSpan ( GCardXor s ) = s
-  getSpan ( GCardOr s ) = s
-  getSpan ( GCardMux s ) = s
-  getSpan ( GCardOpt s ) = s
-  getSpan ( GCardInterval s _ ) = s
-
-instance Spannable Card where
-  getSpan ( CardEmpty s ) = s
-  getSpan ( CardLone s ) = s
-  getSpan ( CardSome s ) = s
-  getSpan ( CardAny s ) = s
-  getSpan ( CardNum s _ ) = s
-  getSpan ( CardInterval s _ ) = s
-
-instance Spannable NCard where
-  getSpan ( NCard s _ _ ) = s
-
-instance Spannable ExInteger where
-  getSpan ( ExIntegerAst s ) = s
-  getSpan ( ExIntegerNum s _ ) = s
-
-instance Spannable Name where
-  getSpan ( Path s _ ) = s
-
-instance Spannable Exp where
-  getSpan ( DeclAllDisj s _ _ ) = s
-  getSpan ( DeclAll s _ _ ) = s
-  getSpan ( DeclQuantDisj s _ _ _ ) = s
-  getSpan ( DeclQuant s _ _ _ ) = s
-  getSpan ( EGMax s _ ) = s
-  getSpan ( EGMin s _ ) = s
-  getSpan ( EIff s _ _ ) = s
-  getSpan ( EImplies s _ _ ) = s
-  getSpan ( EOr s _ _ ) = s
-  getSpan ( EXor s _ _ ) = s
-  getSpan ( EAnd s _ _ ) = s
-  getSpan ( ENeg s _ ) = s
-  getSpan ( ELt s _ _ ) = s
-  getSpan ( EGt s _ _ ) = s
-  getSpan ( EEq s _ _ ) = s
-  getSpan ( ELte s _ _ ) = s
-  getSpan ( EGte s _ _ ) = s
-  getSpan ( ENeq s _ _ ) = s
-  getSpan ( EIn s _ _ ) = s
-  getSpan ( ENin s _ _ ) = s
-  getSpan ( QuantExp s _ _ ) = s
-  getSpan ( EAdd s _ _ ) = s
-  getSpan ( ESub s _ _ ) = s
-  getSpan ( EMul s _ _ ) = s
-  getSpan ( EDiv s _ _ ) = s
-  getSpan ( ESumSetExp s _ ) = s
-  getSpan ( ECSetExp s _ ) = s
-  getSpan ( EMinExp s _ ) = s
-  getSpan ( EImpliesElse s _ _ _ ) = s
-  getSpan ( EInt s _ ) = s
-  getSpan ( EDouble s _ ) = s
-  getSpan ( EStr s _ ) = s
-  getSpan ( ESetExp s _ ) = s
-
-instance Spannable SetExp where
-  getSpan ( Union s _ _ ) = s
-  getSpan ( UnionCom s _ _ ) = s
-  getSpan ( Difference s _ _ ) = s
-  getSpan ( Intersection s _ _ ) = s
-  getSpan ( Domain s _ _ ) = s
-  getSpan ( Range s _ _ ) = s
-  getSpan ( Join s _ _ ) = s
-  getSpan ( ClaferId s _ ) = s
-
-instance Spannable Decl where
-  getSpan ( Decl s _ _ ) = s
-
-instance Spannable Quant where
-  getSpan ( QuantNo s ) = s
-  getSpan ( QuantNot s ) = s
-  getSpan ( QuantLone s ) = s
-  getSpan ( QuantOne s ) = s
-  getSpan ( QuantSome s ) = s
-
-instance Spannable EnumId where
-  getSpan ( EnumIdIdent s _ ) = s
-
-instance Spannable ModId where
-  getSpan ( ModIdIdent s _ ) = s
-
-instance Spannable LocId where
-  getSpan ( LocIdIdent s _ ) = s
-
-instance Spannable PosInteger where
-  getSpan (PosInteger ((c, l), lex')) =
-    Span (Pos c' l') (Pos c' $ l' + len lex')
-    where
-      c' = toInteger c
-      l' = toInteger l
-
-instance Spannable PosDouble where
-  getSpan (PosDouble ((c, l), lex')) =
-    Span (Pos c' l') (Pos c' $ l' + len lex')
-    where
-      c' = toInteger c
-      l' = toInteger l
-
-instance Spannable PosString where
-  getSpan (PosString ((c, l), lex')) =
-    Span (Pos c' l') (Pos c' $ l' + len lex')
-    where
-      c' = toInteger c
-      l' = toInteger l
-
-instance Spannable PosIdent where
-  getSpan (PosIdent ((c, l), lex')) =
-    Span (Pos c' l') (Pos c' $ l' + len lex')
-    where
-      c' = toInteger c
-      l' = toInteger l
-
diff --git a/src/Language/Clafer/Front/ErrM.hs b/src/Language/Clafer/Front/ErrM.hs
--- a/src/Language/Clafer/Front/ErrM.hs
+++ b/src/Language/Clafer/Front/ErrM.hs
@@ -9,7 +9,8 @@
 import Control.Monad (MonadPlus(..), liftM)
 import Control.Applicative (Applicative(..), Alternative(..))
 
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
+
 data Err a = Ok a | Bad Pos String
   deriving (Read, Show, Eq, Ord)
 
diff --git a/src/Language/Clafer/Front/LayoutResolver.hs b/src/Language/Clafer/Front/LayoutResolver.hs
--- a/src/Language/Clafer/Front/LayoutResolver.hs
+++ b/src/Language/Clafer/Front/LayoutResolver.hs
@@ -29,7 +29,7 @@
 import Language.Clafer.Common
 import Language.ClaferT
 
-import Language.Clafer.Front.Lexclafer
+import Language.Clafer.Front.LexClafer
 import Data.Maybe
 
 data LayEnv = LayEnv {
diff --git a/src/Language/Clafer/Front/LexClafer.x b/src/Language/Clafer/Front/LexClafer.x
new file mode 100644
--- /dev/null
+++ b/src/Language/Clafer/Front/LexClafer.x
@@ -0,0 +1,193 @@
+-- -*- haskell -*-
+-- This Alex file was machine-generated by the BNF converter
+{
+{-# OPTIONS -fno-warn-incomplete-patterns #-}
+{-# OPTIONS_GHC -w #-}
+module Language.Clafer.Front.LexClafer where
+
+
+
+import qualified Data.Bits
+import Data.Word (Word8)
+}
+
+
+$l = [a-zA-Z\192 - \255] # [\215 \247]    -- isolatin1 letter FIXME
+$c = [A-Z\192-\221] # [\215]    -- capital isolatin1 letter FIXME
+$s = [a-z\222-\255] # [\247]    -- small isolatin1 letter FIXME
+$d = [0-9]                -- digit
+$i = [$l $d _ ']          -- identifier character
+$u = [\0-\255]          -- universal: any character
+
+@rsyms =    -- symbols and non-identifier-like reserved words
+   \= | \[ | \] | \< \< | \> \> | \{ | \} | \` | \: | \- \> | \- \> \> | \: \= | \? | \+ | \* | \. \. | \| | \< \= \> | \= \> | \| \| | \& \& | \! | \< | \> | \< \= | \> \= | \! \= | \- | \/ | \% | \# | \+ \+ | \, | \- \- | \* \* | \< \: | \: \> | \. | \; | \\ | \( | \)
+
+:-
+"//" [.]* ; -- Toss single line comments
+"/*" ([$u # \*] | \*+ [$u # [\* \/]])* ("*")+ "/" ;
+
+$white+ ;
+@rsyms { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }
+$d + { tok (\p s -> PT p (eitherResIdent (T_PosInteger . share) s)) }
+$d + \. $d + (e \- ? $d +)? { tok (\p s -> PT p (eitherResIdent (T_PosDouble . share) s)) }
+\" ($u # [\" \\]| \\ [\" \\ n t]) * \" { tok (\p s -> PT p (eitherResIdent (T_PosString . share) s)) }
+$l ($l | $d | \_ | \')* { tok (\p s -> PT p (eitherResIdent (T_PosIdent . share) s)) }
+
+$l $i*   { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }
+
+
+
+
+
+{
+
+tok :: (Posn -> String -> Token) -> (Posn -> String -> Token)
+tok f p s = f p s
+
+share :: String -> String
+share = id
+
+data Tok =
+   TS !String !Int    -- reserved words and symbols
+ | TL !String         -- string literals
+ | TI !String         -- integer literals
+ | TV !String         -- identifiers
+ | TD !String         -- double precision float literals
+ | TC !String         -- character literals
+ | T_PosInteger !String
+ | T_PosDouble !String
+ | T_PosString !String
+ | T_PosIdent !String
+
+ deriving (Eq,Show,Ord)
+
+data Token =
+   PT  Posn Tok
+ | Err Posn
+  deriving (Eq,Show,Ord)
+
+tokenPos :: [Token] -> String
+tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
+tokenPos _ = "end of file"
+
+tokenPosn :: Token -> Posn
+tokenPosn (PT p _) = p
+tokenPosn (Err p) = p
+
+tokenLineCol :: Token -> (Int, Int)
+tokenLineCol = posLineCol . tokenPosn
+
+posLineCol :: Posn -> (Int, Int)
+posLineCol (Pn _ l c) = (l,c)
+
+mkPosToken :: Token -> ((Int, Int), String)
+mkPosToken t@(PT p _) = (posLineCol p, prToken t)
+
+prToken :: Token -> String
+prToken t = case t of
+  PT _ (TS s _) -> s
+  PT _ (TL s)   -> show s
+  PT _ (TI s)   -> s
+  PT _ (TV s)   -> s
+  PT _ (TD s)   -> s
+  PT _ (TC s)   -> s
+  PT _ (T_PosInteger s) -> s
+  PT _ (T_PosDouble s) -> s
+  PT _ (T_PosString s) -> s
+  PT _ (T_PosIdent s) -> s
+
+
+data BTree = N | B String Tok BTree BTree deriving (Show)
+
+eitherResIdent :: (String -> Tok) -> String -> Tok
+eitherResIdent tv s = treeFind resWords
+  where
+  treeFind N = tv s
+  treeFind (B a t left right) | s < a  = treeFind left
+                              | s > a  = treeFind right
+                              | s == a = t
+
+resWords :: BTree
+resWords = b ">>" 33 (b "." 17 (b "**" 9 (b "&&" 5 (b "#" 3 (b "!=" 2 (b "!" 1 N N) N) (b "%" 4 N N)) (b ")" 7 (b "(" 6 N N) (b "*" 8 N N))) (b "-" 13 (b "++" 11 (b "+" 10 N N) (b "," 12 N N)) (b "->" 15 (b "--" 14 N N) (b "->>" 16 N N)))) (b "<:" 25 (b ":=" 21 (b "/" 19 (b ".." 18 N N) (b ":" 20 N N)) (b ";" 23 (b ":>" 22 N N) (b "<" 24 N N))) (b "=" 29 (b "<=" 27 (b "<<" 26 N N) (b "<=>" 28 N N)) (b ">" 31 (b "=>" 30 N N) (b ">=" 32 N N))))) (b "min" 49 (b "assert" 41 (b "]" 37 (b "[" 35 (b "?" 34 N N) (b "\\" 36 N N)) (b "abstract" 39 (b "`" 38 N N) (b "all" 40 N N))) (b "if" 45 (b "else" 43 (b "disj" 42 N N) (b "enum" 44 N N)) (b "lone" 47 (b "in" 46 N N) (b "max" 48 N N)))) (b "some" 57 (b "one" 53 (b "no" 51 (b "mux" 50 N N) (b "not" 52 N N)) (b "or" 55 (b "opt" 54 N N) (b "product" 56 N N))) (b "{" 61 (b "then" 59 (b "sum" 58 N N) (b "xor" 60 N N)) (b "||" 63 (b "|" 62 N N) (b "}" 64 N N)))))
+   where b s n = let bs = id s
+                  in B bs (TS bs n)
+
+unescapeInitTail :: String -> String
+unescapeInitTail = id . unesc . tail . id where
+  unesc s = case s of
+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
+    '\\':'n':cs  -> '\n' : unesc cs
+    '\\':'t':cs  -> '\t' : unesc cs
+    '"':[]    -> []
+    c:cs      -> c : unesc cs
+    _         -> []
+
+-------------------------------------------------------------------
+-- Alex wrapper code.
+-- A modified "posn" wrapper.
+-------------------------------------------------------------------
+
+data Posn = Pn !Int !Int !Int
+      deriving (Eq, Show,Ord)
+
+alexStartPos :: Posn
+alexStartPos = Pn 0 1 1
+
+alexMove :: Posn -> Char -> Posn
+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
+
+type Byte = Word8
+
+type AlexInput = (Posn,     -- current position,
+                  Char,     -- previous char
+                  [Byte],   -- pending bytes on the current char
+                  String)   -- current input string
+
+tokens :: String -> [Token]
+tokens str = go (alexStartPos, '\n', [], str)
+    where
+      go :: AlexInput -> [Token]
+      go inp@(pos, _, _, str) =
+               case alexScan inp 0 of
+                AlexEOF                   -> []
+                AlexError (pos, _, _, _)  -> [Err pos]
+                AlexSkip  inp' len        -> go inp'
+                AlexToken inp' len act    -> act pos (take len str) : (go inp')
+
+alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
+alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
+alexGetByte (p, _, [], s) =
+  case  s of
+    []  -> Nothing
+    (c:s) ->
+             let p'     = alexMove p c
+                 (b:bs) = utf8Encode c
+              in p' `seq` Just (b, (p', c, bs, s))
+
+alexInputPrevChar :: AlexInput -> Char
+alexInputPrevChar (p, c, bs, s) = c
+
+-- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
+utf8Encode :: Char -> [Word8]
+utf8Encode = map fromIntegral . go . ord
+ where
+  go oc
+   | oc <= 0x7f       = [oc]
+
+   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+
+   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
+                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
+                        , 0x80 + oc Data.Bits..&. 0x3f
+                        ]
+}
diff --git a/src/Language/Clafer/Front/Lexclafer.x b/src/Language/Clafer/Front/Lexclafer.x
deleted file mode 100644
--- a/src/Language/Clafer/Front/Lexclafer.x
+++ /dev/null
@@ -1,182 +0,0 @@
--- -*- haskell -*-
--- This Alex file was machine-generated by the BNF converter
-{
-{-# OPTIONS -fno-warn-incomplete-patterns #-}
-{-# OPTIONS_GHC -w #-}
-module Language.Clafer.Front.Lexclafer where
-
-
-
-import qualified Data.Bits
-import Data.Word (Word8)
-}
-
-
-$l = [a-zA-Z\192 - \255] # [\215 \247]    -- isolatin1 letter FIXME
-$c = [A-Z\192-\221] # [\215]    -- capital isolatin1 letter FIXME
-$s = [a-z\222-\255] # [\247]    -- small isolatin1 letter FIXME
-$d = [0-9]                -- digit
-$i = [$l $d _ ']          -- identifier character
-$u = [\0-\255]          -- universal: any character
-
-@rsyms =    -- symbols and non-identifier-like reserved words
-   \= | \[ | \] | \< \< | \> \> | \{ | \} | \` | \: | \- \> | \- \> \> | \: \= | \? | \+ | \* | \. \. | \| | \< \= \> | \= \> | \| \| | \& \& | \! | \< | \> | \< \= | \> \= | \! \= | \- | \/ | \# | \+ \+ | \, | \- \- | \* \* | \< \: | \: \> | \. | \; | \\ | \( | \)
-
-:-
-"//" [.]* ; -- Toss single line comments
-"/*" ([$u # \*] | \* [$u # \/])* ("*")+ "/" ; 
-
-$white+ ;
-@rsyms { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }
-$d + { tok (\p s -> PT p (eitherResIdent (T_PosInteger . share) s)) }
-$d + \. $d + (e \- ? $d +)? { tok (\p s -> PT p (eitherResIdent (T_PosDouble . share) s)) }
-\" ($u # [\" \\]| \\ [\" \\ n t]) * \" { tok (\p s -> PT p (eitherResIdent (T_PosString . share) s)) }
-$l ($l | $d | \_ | \')* { tok (\p s -> PT p (eitherResIdent (T_PosIdent . share) s)) }
-
-$l $i*   { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }
-
-
-
-
-
-{
-
-tok f p s = f p s
-
-share :: String -> String
-share = id
-
-data Tok =
-   TS !String !Int    -- reserved words and symbols
- | TL !String         -- string literals
- | TI !String         -- integer literals
- | TV !String         -- identifiers
- | TD !String         -- double precision float literals
- | TC !String         -- character literals
- | T_PosInteger !String
- | T_PosDouble !String
- | T_PosString !String
- | T_PosIdent !String
-
- deriving (Eq,Show,Ord)
-
-data Token = 
-   PT  Posn Tok
- | Err Posn
-  deriving (Eq,Show,Ord)
-
-tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l
-tokenPos (Err (Pn _ l _) :_) = "line " ++ show l
-tokenPos _ = "end of file"
-
-tokenPosn (PT p _) = p
-tokenPosn (Err p) = p
-tokenLineCol = posLineCol . tokenPosn
-posLineCol (Pn _ l c) = (l,c)
-mkPosToken t@(PT p _) = (posLineCol p, prToken t)
-
-prToken t = case t of
-  PT _ (TS s _) -> s
-  PT _ (TL s)   -> s
-  PT _ (TI s)   -> s
-  PT _ (TV s)   -> s
-  PT _ (TD s)   -> s
-  PT _ (TC s)   -> s
-  PT _ (T_PosInteger s) -> s
-  PT _ (T_PosDouble s) -> s
-  PT _ (T_PosString s) -> s
-  PT _ (T_PosIdent s) -> s
-
-
-data BTree = N | B String Tok BTree BTree deriving (Show)
-
-eitherResIdent :: (String -> Tok) -> String -> Tok
-eitherResIdent tv s = treeFind resWords
-  where
-  treeFind N = tv s
-  treeFind (B a t left right) | s < a  = treeFind left
-                              | s > a  = treeFind right
-                              | s == a = t
-
-resWords = b ">>" 32 (b "." 16 (b "**" 8 (b "&&" 4 (b "!=" 2 (b "!" 1 N N) (b "#" 3 N N)) (b ")" 6 (b "(" 5 N N) (b "*" 7 N N))) (b "-" 12 (b "++" 10 (b "+" 9 N N) (b "," 11 N N)) (b "->" 14 (b "--" 13 N N) (b "->>" 15 N N)))) (b "<:" 24 (b ":=" 20 (b "/" 18 (b ".." 17 N N) (b ":" 19 N N)) (b ";" 22 (b ":>" 21 N N) (b "<" 23 N N))) (b "=" 28 (b "<=" 26 (b "<<" 25 N N) (b "<=>" 27 N N)) (b ">" 30 (b "=>" 29 N N) (b ">=" 31 N N))))) (b "min" 48 (b "assert" 40 (b "]" 36 (b "[" 34 (b "?" 33 N N) (b "\\" 35 N N)) (b "abstract" 38 (b "`" 37 N N) (b "all" 39 N N))) (b "if" 44 (b "else" 42 (b "disj" 41 N N) (b "enum" 43 N N)) (b "lone" 46 (b "in" 45 N N) (b "max" 47 N N)))) (b "sum" 56 (b "one" 52 (b "no" 50 (b "mux" 49 N N) (b "not" 51 N N)) (b "or" 54 (b "opt" 53 N N) (b "some" 55 N N))) (b "|" 60 (b "xor" 58 (b "then" 57 N N) (b "{" 59 N N)) (b "}" 62 (b "||" 61 N N) N))))
-   where b s n = let bs = id s
-                  in B bs (TS bs n)
-
-unescapeInitTail :: String -> String
-unescapeInitTail = id . unesc . tail . id where
-  unesc s = case s of
-    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs
-    '\\':'n':cs  -> '\n' : unesc cs
-    '\\':'t':cs  -> '\t' : unesc cs
-    '"':[]    -> []
-    c:cs      -> c : unesc cs
-    _         -> []
-
--------------------------------------------------------------------
--- Alex wrapper code.
--- A modified "posn" wrapper.
--------------------------------------------------------------------
-
-data Posn = Pn !Int !Int !Int
-      deriving (Eq, Show,Ord)
-
-alexStartPos :: Posn
-alexStartPos = Pn 0 1 1
-
-alexMove :: Posn -> Char -> Posn
-alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)
-alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1
-alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)
-
-type Byte = Word8
-
-type AlexInput = (Posn,     -- current position,
-                  Char,     -- previous char
-                  [Byte],   -- pending bytes on the current char
-                  String)   -- current input string
-
-tokens :: String -> [Token]
-tokens str = go (alexStartPos, '\n', [], str)
-    where
-      go :: AlexInput -> [Token]
-      go inp@(pos, _, _, str) =
-               case alexScan inp 0 of
-                AlexEOF                   -> []
-                AlexError (pos, _, _, _)  -> [Err pos]
-                AlexSkip  inp' len        -> go inp'
-                AlexToken inp' len act    -> act pos (take len str) : (go inp')
-
-alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
-alexGetByte (p, c, (b:bs), s) = Just (b, (p, c, bs, s))
-alexGetByte (p, _, [], s) =
-  case  s of
-    []  -> Nothing
-    (c:s) ->
-             let p'     = alexMove p c
-                 (b:bs) = utf8Encode c
-              in p' `seq` Just (b, (p', c, bs, s))
-
-alexInputPrevChar :: AlexInput -> Char
-alexInputPrevChar (p, c, bs, s) = c
-
-  -- | Encode a Haskell String to a list of Word8 values, in UTF8 format.
-utf8Encode :: Char -> [Word8]
-utf8Encode = map fromIntegral . go . ord
- where
-  go oc
-   | oc <= 0x7f       = [oc]
-
-   | oc <= 0x7ff      = [ 0xc0 + (oc `Data.Bits.shiftR` 6)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-
-   | oc <= 0xffff     = [ 0xe0 + (oc `Data.Bits.shiftR` 12)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-   | otherwise        = [ 0xf0 + (oc `Data.Bits.shiftR` 18)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 12) Data.Bits..&. 0x3f)
-                        , 0x80 + ((oc `Data.Bits.shiftR` 6) Data.Bits..&. 0x3f)
-                        , 0x80 + oc Data.Bits..&. 0x3f
-                        ]
-}
diff --git a/src/Language/Clafer/Front/ParClafer.y b/src/Language/Clafer/Front/ParClafer.y
new file mode 100644
--- /dev/null
+++ b/src/Language/Clafer/Front/ParClafer.y
@@ -0,0 +1,302 @@
+-- This Happy file was machine-generated by the BNF converter
+{
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
+module Language.Clafer.Front.ParClafer where
+import Language.Clafer.Front.AbsClafer
+import Language.Clafer.Front.LexClafer
+import Language.Clafer.Front.ErrM
+
+}
+
+%name pModule Module
+%name pClafer Clafer
+%name pConstraint Constraint
+%name pSoftConstraint SoftConstraint
+%name pGoal Goal
+-- no lexer declaration
+%monad { Err } { thenM } { returnM }
+%tokentype {Token}
+%token
+  '!' { 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) }
+  ',' { PT _ (TS _ 12) }
+  '-' { PT _ (TS _ 13) }
+  '--' { PT _ (TS _ 14) }
+  '->' { PT _ (TS _ 15) }
+  '->>' { PT _ (TS _ 16) }
+  '.' { PT _ (TS _ 17) }
+  '..' { PT _ (TS _ 18) }
+  '/' { PT _ (TS _ 19) }
+  ':' { PT _ (TS _ 20) }
+  ':=' { PT _ (TS _ 21) }
+  ':>' { PT _ (TS _ 22) }
+  ';' { PT _ (TS _ 23) }
+  '<' { PT _ (TS _ 24) }
+  '<:' { PT _ (TS _ 25) }
+  '<<' { PT _ (TS _ 26) }
+  '<=' { PT _ (TS _ 27) }
+  '<=>' { PT _ (TS _ 28) }
+  '=' { PT _ (TS _ 29) }
+  '=>' { PT _ (TS _ 30) }
+  '>' { PT _ (TS _ 31) }
+  '>=' { PT _ (TS _ 32) }
+  '>>' { PT _ (TS _ 33) }
+  '?' { PT _ (TS _ 34) }
+  '[' { PT _ (TS _ 35) }
+  '\\' { PT _ (TS _ 36) }
+  ']' { PT _ (TS _ 37) }
+  '`' { PT _ (TS _ 38) }
+  'abstract' { PT _ (TS _ 39) }
+  'all' { PT _ (TS _ 40) }
+  'assert' { PT _ (TS _ 41) }
+  'disj' { PT _ (TS _ 42) }
+  'else' { PT _ (TS _ 43) }
+  'enum' { PT _ (TS _ 44) }
+  'if' { PT _ (TS _ 45) }
+  'in' { PT _ (TS _ 46) }
+  'lone' { PT _ (TS _ 47) }
+  'max' { PT _ (TS _ 48) }
+  'min' { PT _ (TS _ 49) }
+  'mux' { PT _ (TS _ 50) }
+  'no' { PT _ (TS _ 51) }
+  'not' { PT _ (TS _ 52) }
+  'one' { PT _ (TS _ 53) }
+  'opt' { PT _ (TS _ 54) }
+  'or' { PT _ (TS _ 55) }
+  'product' { PT _ (TS _ 56) }
+  'some' { PT _ (TS _ 57) }
+  'sum' { PT _ (TS _ 58) }
+  'then' { PT _ (TS _ 59) }
+  'xor' { PT _ (TS _ 60) }
+  '{' { PT _ (TS _ 61) }
+  '|' { PT _ (TS _ 62) }
+  '||' { PT _ (TS _ 63) }
+  '}' { PT _ (TS _ 64) }
+
+L_PosInteger { PT _ (T_PosInteger _) }
+L_PosDouble { PT _ (T_PosDouble _) }
+L_PosString { PT _ (T_PosString _) }
+L_PosIdent { PT _ (T_PosIdent _) }
+
+
+%%
+
+PosInteger    :: { PosInteger} : L_PosInteger { PosInteger (mkPosToken $1)}
+PosDouble    :: { PosDouble} : L_PosDouble { PosDouble (mkPosToken $1)}
+PosString    :: { PosString} : L_PosString { PosString (mkPosToken $1)}
+PosIdent    :: { PosIdent} : L_PosIdent { PosIdent (mkPosToken $1)}
+
+Module :: { Module }
+Module : ListDeclaration { Module ((mkCatSpan $1)) (reverse $1) }
+Declaration :: { Declaration }
+Declaration : 'enum' PosIdent '=' ListEnumId { EnumDecl ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $2 $4 }
+            | Element { ElementDecl ((mkCatSpan $1)) $1 }
+Clafer :: { Clafer }
+Clafer : Abstract GCard PosIdent Super Reference Card Init Elements { Clafer ((mkCatSpan $1) >- (mkCatSpan $2) >- (mkCatSpan $3) >- (mkCatSpan $4) >- (mkCatSpan $5) >- (mkCatSpan $6) >- (mkCatSpan $7) >- (mkCatSpan $8)) $1 $2 $3 $4 $5 $6 $7 $8 }
+Constraint :: { Constraint }
+Constraint : '[' ListExp ']' { Constraint ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) }
+SoftConstraint :: { SoftConstraint }
+SoftConstraint : 'assert' '[' ListExp ']' { SoftConstraint ((mkTokenSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4)) (reverse $3) }
+Goal :: { Goal }
+Goal : '<<' ListExp '>>' { Goal ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) }
+Abstract :: { Abstract }
+Abstract : {- empty -} { AbstractEmpty noSpan }
+         | 'abstract' { Abstract ((mkTokenSpan $1)) }
+Elements :: { Elements }
+Elements : {- empty -} { ElementsEmpty noSpan }
+         | '{' ListElement '}' { ElementsList ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) }
+Element :: { Element }
+Element : Clafer { Subclafer ((mkCatSpan $1)) $1 }
+        | '`' Name Card Elements { ClaferUse ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkCatSpan $3) >- (mkCatSpan $4)) $2 $3 $4 }
+        | Constraint { Subconstraint ((mkCatSpan $1)) $1 }
+        | Goal { Subgoal ((mkCatSpan $1)) $1 }
+        | SoftConstraint { Subsoftconstraint ((mkCatSpan $1)) $1 }
+Super :: { Super }
+Super : {- empty -} { SuperEmpty noSpan }
+      | ':' SetExp { SuperSome ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+Reference :: { Reference }
+Reference : {- empty -} { ReferenceEmpty noSpan }
+          | '->' SetExp { ReferenceSet ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+          | '->>' SetExp { ReferenceBag ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+Init :: { Init }
+Init : {- empty -} { InitEmpty noSpan }
+     | InitHow Exp { InitSome ((mkCatSpan $1) >- (mkCatSpan $2)) $1 $2 }
+InitHow :: { InitHow }
+InitHow : '=' { InitConstant ((mkTokenSpan $1)) }
+        | ':=' { InitDefault ((mkTokenSpan $1)) }
+GCard :: { GCard }
+GCard : {- empty -} { GCardEmpty noSpan }
+      | 'xor' { GCardXor ((mkTokenSpan $1)) }
+      | 'or' { GCardOr ((mkTokenSpan $1)) }
+      | 'mux' { GCardMux ((mkTokenSpan $1)) }
+      | 'opt' { GCardOpt ((mkTokenSpan $1)) }
+      | NCard { GCardInterval ((mkCatSpan $1)) $1 }
+Card :: { Card }
+Card : {- empty -} { CardEmpty noSpan }
+     | '?' { CardLone ((mkTokenSpan $1)) }
+     | '+' { CardSome ((mkTokenSpan $1)) }
+     | '*' { CardAny ((mkTokenSpan $1)) }
+     | PosInteger { CardNum ((mkCatSpan $1)) $1 }
+     | NCard { CardInterval ((mkCatSpan $1)) $1 }
+NCard :: { NCard }
+NCard : PosInteger '..' ExInteger { NCard ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+ExInteger :: { ExInteger }
+ExInteger : '*' { ExIntegerAst ((mkTokenSpan $1)) }
+          | PosInteger { ExIntegerNum ((mkCatSpan $1)) $1 }
+Name :: { Name }
+Name : ListModId { Path ((mkCatSpan $1)) $1 }
+Exp :: { Exp }
+Exp : 'all' 'disj' Decl '|' Exp { DeclAllDisj ((mkTokenSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4) >- (mkCatSpan $5)) $3 $5 }
+    | 'all' Decl '|' Exp { DeclAll ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $2 $4 }
+    | Quant 'disj' Decl '|' Exp { DeclQuantDisj ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4) >- (mkCatSpan $5)) $1 $3 $5 }
+    | Quant Decl '|' Exp { DeclQuant ((mkCatSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $1 $2 $4 }
+    | Exp1 {  $1 }
+Exp1 :: { Exp }
+Exp1 : 'max' Exp2 { EGMax ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+     | 'min' Exp2 { EGMin ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+     | Exp1 '<=>' Exp2 { EIff ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp2 {  $1 }
+Exp2 :: { Exp }
+Exp2 : Exp2 '=>' Exp3 { EImplies ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp3 {  $1 }
+Exp3 :: { Exp }
+Exp3 : Exp3 '||' Exp4 { EOr ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp4 {  $1 }
+Exp4 :: { Exp }
+Exp4 : Exp4 'xor' Exp5 { EXor ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp5 {  $1 }
+Exp5 :: { Exp }
+Exp5 : Exp5 '&&' Exp6 { EAnd ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp6 {  $1 }
+Exp6 :: { Exp }
+Exp6 : '!' Exp7 { ENeg ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+     | Exp7 {  $1 }
+Exp7 :: { Exp }
+Exp7 : Exp7 '<' Exp8 { ELt ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 '>' Exp8 { EGt ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 '=' Exp8 { EEq ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 '<=' Exp8 { ELte ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 '>=' Exp8 { EGte ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 '!=' Exp8 { ENeq ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 'in' Exp8 { EIn ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp7 'not' 'in' Exp8 { ENin ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $1 $4 }
+     | Exp8 {  $1 }
+Exp8 :: { Exp }
+Exp8 : Quant Exp12 { QuantExp ((mkCatSpan $1) >- (mkCatSpan $2)) $1 $2 }
+     | Exp9 {  $1 }
+Exp9 :: { Exp }
+Exp9 : Exp9 '+' Exp10 { EAdd ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp9 '-' Exp10 { ESub ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+     | Exp10 {  $1 }
+Exp10 :: { Exp }
+Exp10 : Exp10 '*' Exp11 { EMul ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+      | Exp10 '/' Exp11 { EDiv ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+      | Exp10 '%' Exp11 { ERem ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+      | Exp11 {  $1 }
+Exp11 :: { Exp }
+Exp11 : 'sum' Exp12 { ESumSetExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+      | 'product' Exp12 { EProdSetExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+      | '#' Exp12 { ECSetExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+      | '-' Exp12 { EMinExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
+      | Exp12 {  $1 }
+Exp12 :: { Exp }
+Exp12 : 'if' Exp12 'then' Exp12 'else' Exp13 { EImpliesElse ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4) >- (mkTokenSpan $5) >- (mkCatSpan $6)) $2 $4 $6 }
+      | Exp13 {  $1 }
+Exp13 :: { Exp }
+Exp13 : PosInteger { EInt ((mkCatSpan $1)) $1 }
+      | PosDouble { EDouble ((mkCatSpan $1)) $1 }
+      | PosString { EStr ((mkCatSpan $1)) $1 }
+      | SetExp { ESetExp ((mkCatSpan $1)) $1 }
+      | '(' Exp ')' {  $2 }
+SetExp :: { SetExp }
+SetExp : SetExp '++' SetExp1 { Union ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+       | SetExp ',' SetExp1 { UnionCom ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+       | SetExp1 {  $1 }
+SetExp1 :: { SetExp }
+SetExp1 : SetExp1 '--' SetExp2 { Difference ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+        | SetExp2 {  $1 }
+SetExp2 :: { SetExp }
+SetExp2 : SetExp2 '**' SetExp3 { Intersection ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+        | SetExp3 {  $1 }
+SetExp3 :: { SetExp }
+SetExp3 : SetExp3 '<:' SetExp4 { Domain ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+        | SetExp4 {  $1 }
+SetExp4 :: { SetExp }
+SetExp4 : SetExp4 ':>' SetExp5 { Range ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+        | SetExp5 {  $1 }
+SetExp5 :: { SetExp }
+SetExp5 : SetExp5 '.' SetExp6 { Join ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+        | SetExp6 {  $1 }
+SetExp6 :: { SetExp }
+SetExp6 : Name { ClaferId ((mkCatSpan $1)) $1 }
+        | '(' SetExp ')' {  $2 }
+Decl :: { Decl }
+Decl : ListLocId ':' SetExp { Decl ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
+Quant :: { Quant }
+Quant : 'no' { QuantNo ((mkTokenSpan $1)) }
+      | 'not' { QuantNot ((mkTokenSpan $1)) }
+      | 'lone' { QuantLone ((mkTokenSpan $1)) }
+      | 'one' { QuantOne ((mkTokenSpan $1)) }
+      | 'some' { QuantSome ((mkTokenSpan $1)) }
+EnumId :: { EnumId }
+EnumId : PosIdent { EnumIdIdent ((mkCatSpan $1)) $1 }
+ModId :: { ModId }
+ModId : PosIdent { ModIdIdent ((mkCatSpan $1)) $1 }
+LocId :: { LocId }
+LocId : PosIdent { LocIdIdent ((mkCatSpan $1)) $1 }
+ListDeclaration :: { [Declaration] }
+ListDeclaration : {- empty -} { []  }
+                | ListDeclaration Declaration { flip (:)  $1 $2 }
+ListEnumId :: { [EnumId] }
+ListEnumId : EnumId { (:[])  $1 }
+           | EnumId '|' ListEnumId { (:)  $1 $3 }
+ListElement :: { [Element] }
+ListElement : {- empty -} { []  }
+            | ListElement Element { flip (:)  $1 $2 }
+ListExp :: { [Exp] }
+ListExp : {- empty -} { []  } | ListExp Exp { flip (:)  $1 $2 }
+ListLocId :: { [LocId] }
+ListLocId : LocId { (:[])  $1 }
+          | LocId ';' ListLocId { (:)  $1 $3 }
+ListModId :: { [ModId] }
+ListModId : ModId { (:[])  $1 }
+          | ModId '\\' ListModId { (:)  $1 $3 }
+{
+
+returnM :: a -> Err a
+returnM = return
+
+thenM :: Err a -> (a -> Err b) -> Err b
+thenM = (>>=)
+
+happyError :: [Token] -> Err a
+happyError ts =
+  Bad (pp ts) $ "syntax error at " ++ tokenPos ts ++ 
+  case ts of
+    [] -> []
+    [Err _] -> " due to lexer error"
+    _ -> " before " ++ unwords (map (id . prToken) (take 4 ts))
+
+myLexer = tokens
+
+gp x@(PT (Pn _ l c) _) = Span (Pos (toInteger l) (toInteger c)) (Pos (toInteger l) (toInteger c + toInteger (length $ prToken x)))
+pp (PT (Pn _ l c) _ :_) = Pos (toInteger l) (toInteger c)
+pp (Err (Pn _ l c) :_) = Pos (toInteger l) (toInteger c)
+pp _ = error "EOF"
+
+mkCatSpan :: (Spannable c) => c -> Span
+mkCatSpan = getSpan
+
+mkTokenSpan :: Token -> Span
+mkTokenSpan = gp
+}
+
diff --git a/src/Language/Clafer/Front/Parclafer.y b/src/Language/Clafer/Front/Parclafer.y
deleted file mode 100644
--- a/src/Language/Clafer/Front/Parclafer.y
+++ /dev/null
@@ -1,402 +0,0 @@
--- This Happy file was machine-generated by the BNF converter
-{
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}
-module Language.Clafer.Front.Parclafer where
-import Language.Clafer.Front.Absclafer
-import Language.Clafer.Front.Lexclafer
-import Language.Clafer.Front.ErrM
-
-}
-
-%name pModule Module
-%name pClafer Clafer
-%name pConstraint Constraint
-%name pSoftConstraint SoftConstraint
-%name pGoal Goal
-
--- no lexer declaration
-%monad { Err } { thenM } { returnM }
-%tokentype { Token }
-
-%token 
- '!' { 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) }
- '-' { PT _ (TS _ 12) }
- '--' { PT _ (TS _ 13) }
- '->' { PT _ (TS _ 14) }
- '->>' { PT _ (TS _ 15) }
- '.' { PT _ (TS _ 16) }
- '..' { PT _ (TS _ 17) }
- '/' { PT _ (TS _ 18) }
- ':' { PT _ (TS _ 19) }
- ':=' { PT _ (TS _ 20) }
- ':>' { PT _ (TS _ 21) }
- ';' { PT _ (TS _ 22) }
- '<' { PT _ (TS _ 23) }
- '<:' { PT _ (TS _ 24) }
- '<<' { PT _ (TS _ 25) }
- '<=' { PT _ (TS _ 26) }
- '<=>' { PT _ (TS _ 27) }
- '=' { PT _ (TS _ 28) }
- '=>' { PT _ (TS _ 29) }
- '>' { PT _ (TS _ 30) }
- '>=' { PT _ (TS _ 31) }
- '>>' { PT _ (TS _ 32) }
- '?' { PT _ (TS _ 33) }
- '[' { PT _ (TS _ 34) }
- '\\' { PT _ (TS _ 35) }
- ']' { PT _ (TS _ 36) }
- '`' { PT _ (TS _ 37) }
- 'abstract' { PT _ (TS _ 38) }
- 'all' { PT _ (TS _ 39) }
- 'assert' { PT _ (TS _ 40) }
- 'disj' { PT _ (TS _ 41) }
- 'else' { PT _ (TS _ 42) }
- 'enum' { PT _ (TS _ 43) }
- 'if' { PT _ (TS _ 44) }
- 'in' { PT _ (TS _ 45) }
- 'lone' { PT _ (TS _ 46) }
- 'max' { PT _ (TS _ 47) }
- 'min' { PT _ (TS _ 48) }
- 'mux' { PT _ (TS _ 49) }
- 'no' { PT _ (TS _ 50) }
- 'not' { PT _ (TS _ 51) }
- 'one' { PT _ (TS _ 52) }
- 'opt' { PT _ (TS _ 53) }
- 'or' { PT _ (TS _ 54) }
- 'some' { PT _ (TS _ 55) }
- 'sum' { PT _ (TS _ 56) }
- 'then' { PT _ (TS _ 57) }
- 'xor' { PT _ (TS _ 58) }
- '{' { PT _ (TS _ 59) }
- '|' { PT _ (TS _ 60) }
- '||' { PT _ (TS _ 61) }
- '}' { PT _ (TS _ 62) }
-
-L_PosInteger { PT _ (T_PosInteger _) }
-L_PosDouble { PT _ (T_PosDouble _) }
-L_PosString { PT _ (T_PosString _) }
-L_PosIdent { PT _ (T_PosIdent _) }
-L_err    { _ }
-
-
-%%
-
-PosInteger    :: { PosInteger} : L_PosInteger { PosInteger (mkPosToken $1)}
-PosDouble    :: { PosDouble} : L_PosDouble { PosDouble (mkPosToken $1)}
-PosString    :: { PosString} : L_PosString { PosString (mkPosToken $1)}
-PosIdent    :: { PosIdent} : L_PosIdent { PosIdent (mkPosToken $1)}
-
-Module :: { Module }
-Module : ListDeclaration { Module ((mkCatSpan $1)) (reverse $1) } 
-
-
-Declaration :: { Declaration }
-Declaration : 'enum' PosIdent '=' ListEnumId { EnumDecl ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $2 $4 } 
-  | Element { ElementDecl ((mkCatSpan $1)) $1 }
-
-
-Clafer :: { Clafer }
-Clafer : Abstract GCard PosIdent Super Reference Card Init Elements { Clafer ((mkCatSpan $1) >- (mkCatSpan $2) >- (mkCatSpan $3) >- (mkCatSpan $4) >- (mkCatSpan $5) >- (mkCatSpan $6) >- (mkCatSpan $7) >- (mkCatSpan $8)) $1 $2 $3 $4 $5 $6 $7 $8 } 
-
-
-Constraint :: { Constraint }
-Constraint : '[' ListExp ']' { Constraint ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) } 
-
-
-SoftConstraint :: { SoftConstraint }
-SoftConstraint : 'assert' '[' ListExp ']' { SoftConstraint ((mkTokenSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4)) (reverse $3) } 
-
-
-Goal :: { Goal }
-Goal : '<<' ListExp '>>' { Goal ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) } 
-
-
-Abstract :: { Abstract }
-Abstract : {- empty -} { AbstractEmpty noSpan } 
-  | 'abstract' { Abstract ((mkTokenSpan $1)) }
-
-
-Elements :: { Elements }
-Elements : {- empty -} { ElementsEmpty noSpan } 
-  | '{' ListElement '}' { ElementsList ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3)) (reverse $2) }
-
-
-Element :: { Element }
-Element : Clafer { Subclafer ((mkCatSpan $1)) $1 } 
-  | '`' Name Card Elements { ClaferUse ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkCatSpan $3) >- (mkCatSpan $4)) $2 $3 $4 }
-  | Constraint { Subconstraint ((mkCatSpan $1)) $1 }
-  | Goal { Subgoal ((mkCatSpan $1)) $1 }
-  | SoftConstraint { Subsoftconstraint ((mkCatSpan $1)) $1 }
-
-
-Super :: { Super }
-Super : {- empty -} { SuperEmpty noSpan } 
-  | ':' SetExp { SuperSome ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-
-
-Reference :: { Reference }
-Reference : {- empty -} { ReferenceEmpty noSpan } 
-  | '->' SetExp { ReferenceSet ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-  | '->>' SetExp { ReferenceBag ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-
-
-Init :: { Init }
-Init : {- empty -} { InitEmpty noSpan } 
-  | InitHow Exp { InitSome ((mkCatSpan $1) >- (mkCatSpan $2)) $1 $2 }
-
-
-InitHow :: { InitHow }
-InitHow : '=' { InitConstant ((mkTokenSpan $1)) } 
-  | ':=' { InitDefault ((mkTokenSpan $1)) }
-
-
-GCard :: { GCard }
-GCard : {- empty -} { GCardEmpty noSpan } 
-  | 'xor' { GCardXor ((mkTokenSpan $1)) }
-  | 'or' { GCardOr ((mkTokenSpan $1)) }
-  | 'mux' { GCardMux ((mkTokenSpan $1)) }
-  | 'opt' { GCardOpt ((mkTokenSpan $1)) }
-  | NCard { GCardInterval ((mkCatSpan $1)) $1 }
-
-
-Card :: { Card }
-Card : {- empty -} { CardEmpty noSpan } 
-  | '?' { CardLone ((mkTokenSpan $1)) }
-  | '+' { CardSome ((mkTokenSpan $1)) }
-  | '*' { CardAny ((mkTokenSpan $1)) }
-  | PosInteger { CardNum ((mkCatSpan $1)) $1 }
-  | NCard { CardInterval ((mkCatSpan $1)) $1 }
-
-
-NCard :: { NCard }
-NCard : PosInteger '..' ExInteger { NCard ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-
-
-ExInteger :: { ExInteger }
-ExInteger : '*' { ExIntegerAst ((mkTokenSpan $1)) } 
-  | PosInteger { ExIntegerNum ((mkCatSpan $1)) $1 }
-
-
-Name :: { Name }
-Name : ListModId { Path ((mkCatSpan $1)) $1 } 
-
-
-Exp :: { Exp }
-Exp : 'all' 'disj' Decl '|' Exp { DeclAllDisj ((mkTokenSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4) >- (mkCatSpan $5)) $3 $5 } 
-  | 'all' Decl '|' Exp { DeclAll ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $2 $4 }
-  | Quant 'disj' Decl '|' Exp { DeclQuantDisj ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3) >- (mkTokenSpan $4) >- (mkCatSpan $5)) $1 $3 $5 }
-  | Quant Decl '|' Exp { DeclQuant ((mkCatSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $1 $2 $4 }
-  | Exp1 {  $1 }
-
-
-Exp1 :: { Exp }
-Exp1 : 'max' Exp2 { EGMax ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 } 
-  | 'min' Exp2 { EGMin ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-  | Exp1 '<=>' Exp2 { EIff ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp2 {  $1 }
-
-
-Exp2 :: { Exp }
-Exp2 : Exp2 '=>' Exp3 { EImplies ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp3 {  $1 }
-
-
-Exp3 :: { Exp }
-Exp3 : Exp3 '||' Exp4 { EOr ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp4 {  $1 }
-
-
-Exp4 :: { Exp }
-Exp4 : Exp4 'xor' Exp5 { EXor ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp5 {  $1 }
-
-
-Exp5 :: { Exp }
-Exp5 : Exp5 '&&' Exp6 { EAnd ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp6 {  $1 }
-
-
-Exp6 :: { Exp }
-Exp6 : '!' Exp7 { ENeg ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 } 
-  | Exp7 {  $1 }
-
-
-Exp7 :: { Exp }
-Exp7 : Exp7 '<' Exp8 { ELt ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp7 '>' Exp8 { EGt ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 '=' Exp8 { EEq ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 '<=' Exp8 { ELte ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 '>=' Exp8 { EGte ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 '!=' Exp8 { ENeq ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 'in' Exp8 { EIn ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp7 'not' 'in' Exp8 { ENin ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4)) $1 $4 }
-  | Exp8 {  $1 }
-
-
-Exp8 :: { Exp }
-Exp8 : Quant Exp12 { QuantExp ((mkCatSpan $1) >- (mkCatSpan $2)) $1 $2 } 
-  | Exp9 {  $1 }
-
-
-Exp9 :: { Exp }
-Exp9 : Exp9 '+' Exp10 { EAdd ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp9 '-' Exp10 { ESub ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp10 {  $1 }
-
-
-Exp10 :: { Exp }
-Exp10 : Exp10 '*' Exp11 { EMul ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | Exp10 '/' Exp11 { EDiv ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | Exp11 {  $1 }
-
-
-Exp11 :: { Exp }
-Exp11 : 'sum' Exp12 { ESumSetExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 } 
-  | '#' Exp12 { ECSetExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-  | '-' Exp12 { EMinExp ((mkTokenSpan $1) >- (mkCatSpan $2)) $2 }
-  | Exp12 {  $1 }
-
-
-Exp12 :: { Exp }
-Exp12 : 'if' Exp12 'then' Exp12 'else' Exp13 { EImpliesElse ((mkTokenSpan $1) >- (mkCatSpan $2) >- (mkTokenSpan $3) >- (mkCatSpan $4) >- (mkTokenSpan $5) >- (mkCatSpan $6)) $2 $4 $6 } 
-  | Exp13 {  $1 }
-
-
-Exp13 :: { Exp }
-Exp13 : PosInteger { EInt ((mkCatSpan $1)) $1 } 
-  | PosDouble { EDouble ((mkCatSpan $1)) $1 }
-  | PosString { EStr ((mkCatSpan $1)) $1 }
-  | SetExp { ESetExp ((mkCatSpan $1)) $1 }
-  | '(' Exp ')' {  $2 }
-
-
-SetExp :: { SetExp }
-SetExp : SetExp '++' SetExp1 { Union ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp ',' SetExp1 { UnionCom ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 }
-  | SetExp1 {  $1 }
-
-
-SetExp1 :: { SetExp }
-SetExp1 : SetExp1 '--' SetExp2 { Difference ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp2 {  $1 }
-
-
-SetExp2 :: { SetExp }
-SetExp2 : SetExp2 '**' SetExp3 { Intersection ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp3 {  $1 }
-
-
-SetExp3 :: { SetExp }
-SetExp3 : SetExp3 '<:' SetExp4 { Domain ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp4 {  $1 }
-
-
-SetExp4 :: { SetExp }
-SetExp4 : SetExp4 ':>' SetExp5 { Range ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp5 {  $1 }
-
-
-SetExp5 :: { SetExp }
-SetExp5 : SetExp5 '.' SetExp6 { Join ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-  | SetExp6 {  $1 }
-
-
-SetExp6 :: { SetExp }
-SetExp6 : Name { ClaferId ((mkCatSpan $1)) $1 } 
-  | '(' SetExp ')' {  $2 }
-
-
-Decl :: { Decl }
-Decl : ListLocId ':' SetExp { Decl ((mkCatSpan $1) >- (mkTokenSpan $2) >- (mkCatSpan $3)) $1 $3 } 
-
-
-Quant :: { Quant }
-Quant : 'no' { QuantNo ((mkTokenSpan $1)) } 
-  | 'not' { QuantNot ((mkTokenSpan $1)) }
-  | 'lone' { QuantLone ((mkTokenSpan $1)) }
-  | 'one' { QuantOne ((mkTokenSpan $1)) }
-  | 'some' { QuantSome ((mkTokenSpan $1)) }
-
-
-EnumId :: { EnumId }
-EnumId : PosIdent { EnumIdIdent ((mkCatSpan $1)) $1 } 
-
-
-ModId :: { ModId }
-ModId : PosIdent { ModIdIdent ((mkCatSpan $1)) $1 } 
-
-
-LocId :: { LocId }
-LocId : PosIdent { LocIdIdent ((mkCatSpan $1)) $1 } 
-
-
-ListDeclaration :: { [Declaration] }
-ListDeclaration : {- empty -} { []  } 
-  | ListDeclaration Declaration { flip (:)  $1 $2 }
-
-
-ListEnumId :: { [EnumId] }
-ListEnumId : EnumId { (:[])  $1 } 
-  | EnumId '|' ListEnumId { (:)  $1 $3 }
-
-
-ListElement :: { [Element] }
-ListElement : {- empty -} { []  } 
-  | ListElement Element { flip (:)  $1 $2 }
-
-
-ListExp :: { [Exp] }
-ListExp : {- empty -} { []  } 
-  | ListExp Exp { flip (:)  $1 $2 }
-
-
-ListLocId :: { [LocId] }
-ListLocId : LocId { (:[])  $1 } 
-  | LocId ';' ListLocId { (:)  $1 $3 }
-
-
-ListModId :: { [ModId] }
-ListModId : ModId { (:[])  $1 } 
-  | ModId '\\' ListModId { (:)  $1 $3 }
-
-
-
-{
-
-returnM :: a -> Err a
-returnM = return
-
-thenM :: Err a -> (a -> Err b) -> Err b
-thenM = (>>=)
-
-happyError :: [Token] -> Err a
-happyError ts =
-  Bad (pp ts) $
-  case ts of
-    [] -> []
-    [Err _] -> " due to lexer error"
-    _ -> "before " ++ unwords (map (id . prToken) (take 4 ts))
-
-gp x@(PT (Pn _ l c) _) = Span (Pos (toInteger l) (toInteger c)) (Pos (toInteger l) (toInteger c + toInteger (length $ prToken x)))
-pp (PT (Pn _ l c) _ :_) = Pos (toInteger l) (toInteger c)
-pp (Err (Pn _ l c) :_) = Pos (toInteger l) (toInteger c)
-pp _ = error "EOF"
-
-mkCatSpan :: (Spannable c) => c -> Span
-mkCatSpan = getSpan
-
-mkTokenSpan :: Token -> Span
-mkTokenSpan = gp
-myLexer = tokens
-}
-
diff --git a/src/Language/Clafer/Front/PrintClafer.hs b/src/Language/Clafer/Front/PrintClafer.hs
new file mode 100644
--- /dev/null
+++ b/src/Language/Clafer/Front/PrintClafer.hs
@@ -0,0 +1,285 @@
+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
+module Language.Clafer.Front.PrintClafer where
+
+-- pretty-printer generated by the BNF converter
+
+import Language.Clafer.Front.AbsClafer
+import Data.Char
+
+
+-- the top-level printing method
+printTree :: Print a => a -> String
+printTree = render . prt 0
+
+type Doc = [ShowS] -> [ShowS]
+
+doc :: ShowS -> Doc
+doc = (:)
+
+render :: Doc -> String
+render d = rend 0 (map ($ "") $ d []) "" where
+  rend i ss = case ss of
+    "["      :ts -> showChar '[' . rend i ts
+    "("      :ts -> showChar '(' . rend i ts
+    "{"      :ts -> showChar '{' . new (i+1) . rend (i+1) ts
+    "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
+    "}"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
+    ";"      :ts -> showChar ';' . new i . rend i ts
+    t  : "," :ts -> showString t . space "," . rend i ts
+    t  : ")" :ts -> showString t . showChar ')' . rend i ts
+    t  : "]" :ts -> showString t . showChar ']' . rend i ts
+    t        :ts -> space t . rend i ts
+    _            -> id
+  new i   = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
+  space t = showString t . (\s -> if null s then "" else (' ':s))
+
+parenth :: Doc -> Doc
+parenth ss = doc (showChar '(') . ss . doc (showChar ')')
+
+concatS :: [ShowS] -> ShowS
+concatS = foldr (.) id
+
+concatD :: [Doc] -> Doc
+concatD = foldr (.) id
+
+replicateS :: Int -> ShowS -> ShowS
+replicateS n f = concatS (replicate n f)
+
+-- the printer class does the job
+class Print a where
+  prt :: Int -> a -> Doc
+  prtList :: [a] -> Doc
+  prtList = concatD . map (prt 0)
+
+instance Print a => Print [a] where
+  prt _ = prtList
+
+instance Print Char where
+  prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'')
+  prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"')
+
+mkEsc :: Char -> Char -> ShowS
+mkEsc q s = case s of
+  _ | s == q -> showChar '\\' . showChar s
+  '\\'-> showString "\\\\"
+  '\n' -> showString "\\n"
+  '\t' -> showString "\\t"
+  _ -> showChar s
+
+prPrec :: Int -> Int -> Doc -> Doc
+prPrec i j = if j<i then parenth else id
+
+
+instance Print Integer where
+  prt _ x = doc (shows x)
+
+
+instance Print Double where
+  prt _ x = doc (shows x)
+
+
+
+instance Print PosInteger where
+  prt _ (PosInteger (_,i)) = doc (showString ( i))
+
+
+instance Print PosDouble where
+  prt _ (PosDouble (_,i)) = doc (showString ( i))
+
+
+instance Print PosString where
+  prt _ (PosString (_,i)) = doc (showString ( i))
+
+
+instance Print PosIdent where
+  prt _ (PosIdent (_,i)) = doc (showString ( i))
+
+
+
+instance Print Module where
+  prt i e = case e of
+    Module _ declarations -> prPrec i 0 (concatD [prt 0 declarations])
+
+instance Print Declaration where
+  prt i e = case e of
+    EnumDecl _ posident enumids -> prPrec i 0 (concatD [doc (showString "enum"), prt 0 posident, doc (showString "="), prt 0 enumids])
+    ElementDecl _ element -> prPrec i 0 (concatD [prt 0 element])
+  prtList es = case es of
+   [] -> (concatD [])
+   x:xs -> (concatD [prt 0 x, prt 0 xs])
+
+instance Print Clafer where
+  prt i e = case e of
+    Clafer _ abstract gcard posident super reference card init elements -> prPrec i 0 (concatD [prt 0 abstract, prt 0 gcard, prt 0 posident, prt 0 super, prt 0 reference, prt 0 card, prt 0 init, prt 0 elements])
+
+instance Print Constraint where
+  prt i e = case e of
+    Constraint _ exps -> prPrec i 0 (concatD [doc (showString "["), prt 0 exps, doc (showString "]")])
+
+instance Print SoftConstraint where
+  prt i e = case e of
+    SoftConstraint _ exps -> prPrec i 0 (concatD [doc (showString "assert"), doc (showString "["), prt 0 exps, doc (showString "]")])
+
+instance Print Goal where
+  prt i e = case e of
+    Goal _ exps -> prPrec i 0 (concatD [doc (showString "<<"), prt 0 exps, doc (showString ">>")])
+
+instance Print Abstract where
+  prt i e = case e of
+    AbstractEmpty _ -> prPrec i 0 (concatD [])
+    Abstract _ -> prPrec i 0 (concatD [doc (showString "abstract")])
+
+instance Print Elements where
+  prt i e = case e of
+    ElementsEmpty _ -> prPrec i 0 (concatD [])
+    ElementsList _ elements -> prPrec i 0 (concatD [doc (showString "{"), prt 0 elements, doc (showString "}")])
+
+instance Print Element where
+  prt i e = case e of
+    Subclafer _ clafer -> prPrec i 0 (concatD [prt 0 clafer])
+    ClaferUse _ name card elements -> prPrec i 0 (concatD [doc (showString "`"), prt 0 name, prt 0 card, prt 0 elements])
+    Subconstraint _ constraint -> prPrec i 0 (concatD [prt 0 constraint])
+    Subgoal _ goal -> prPrec i 0 (concatD [prt 0 goal])
+    Subsoftconstraint _ softconstraint -> prPrec i 0 (concatD [prt 0 softconstraint])
+  prtList es = case es of
+   [] -> (concatD [])
+   x:xs -> (concatD [prt 0 x, prt 0 xs])
+
+instance Print Super where
+  prt i e = case e of
+    SuperEmpty _ -> prPrec i 0 (concatD [])
+    SuperSome _ setexp -> prPrec i 0 (concatD [doc (showString ":"), prt 0 setexp])
+
+instance Print Reference where
+  prt i e = case e of
+    ReferenceEmpty _ -> prPrec i 0 (concatD [])
+    ReferenceSet _ setexp -> prPrec i 0 (concatD [doc (showString "->"), prt 0 setexp])
+    ReferenceBag _ setexp -> prPrec i 0 (concatD [doc (showString "->>"), prt 0 setexp])
+
+instance Print Init where
+  prt i e = case e of
+    InitEmpty _ -> prPrec i 0 (concatD [])
+    InitSome _ inithow exp -> prPrec i 0 (concatD [prt 0 inithow, prt 0 exp])
+
+instance Print InitHow where
+  prt i e = case e of
+    InitConstant _ -> prPrec i 0 (concatD [doc (showString "=")])
+    InitDefault _ -> prPrec i 0 (concatD [doc (showString ":=")])
+
+instance Print GCard where
+  prt i e = case e of
+    GCardEmpty _ -> prPrec i 0 (concatD [])
+    GCardXor _ -> prPrec i 0 (concatD [doc (showString "xor")])
+    GCardOr _ -> prPrec i 0 (concatD [doc (showString "or")])
+    GCardMux _ -> prPrec i 0 (concatD [doc (showString "mux")])
+    GCardOpt _ -> prPrec i 0 (concatD [doc (showString "opt")])
+    GCardInterval _ ncard -> prPrec i 0 (concatD [prt 0 ncard])
+
+instance Print Card where
+  prt i e = case e of
+    CardEmpty _ -> prPrec i 0 (concatD [])
+    CardLone _ -> prPrec i 0 (concatD [doc (showString "?")])
+    CardSome _ -> prPrec i 0 (concatD [doc (showString "+")])
+    CardAny _ -> prPrec i 0 (concatD [doc (showString "*")])
+    CardNum _ posinteger -> prPrec i 0 (concatD [prt 0 posinteger])
+    CardInterval _ ncard -> prPrec i 0 (concatD [prt 0 ncard])
+
+instance Print NCard where
+  prt i e = case e of
+    NCard _ posinteger exinteger -> prPrec i 0 (concatD [prt 0 posinteger, doc (showString ".."), prt 0 exinteger])
+
+instance Print ExInteger where
+  prt i e = case e of
+    ExIntegerAst _ -> prPrec i 0 (concatD [doc (showString "*")])
+    ExIntegerNum _ posinteger -> prPrec i 0 (concatD [prt 0 posinteger])
+
+instance Print Name where
+  prt i e = case e of
+    Path _ modids -> prPrec i 0 (concatD [prt 0 modids])
+
+instance Print Exp where
+  prt i e = case e of
+    DeclAllDisj _ decl exp -> prPrec i 0 (concatD [doc (showString "all"), doc (showString "disj"), prt 0 decl, doc (showString "|"), prt 0 exp])
+    DeclAll _ decl exp -> prPrec i 0 (concatD [doc (showString "all"), prt 0 decl, doc (showString "|"), prt 0 exp])
+    DeclQuantDisj _ quant decl exp -> prPrec i 0 (concatD [prt 0 quant, doc (showString "disj"), prt 0 decl, doc (showString "|"), prt 0 exp])
+    DeclQuant _ quant decl exp -> prPrec i 0 (concatD [prt 0 quant, prt 0 decl, doc (showString "|"), prt 0 exp])
+    EGMax _ exp2 -> prPrec i 1 (concatD [doc (showString "max"), prt 2 exp2])
+    EGMin _ exp2 -> prPrec i 1 (concatD [doc (showString "min"), prt 2 exp2])
+    EIff _ exp1 exp2 -> prPrec i 1 (concatD [prt 1 exp1, doc (showString "<=>"), prt 2 exp2])
+    EImplies _ exp2 exp3 -> prPrec i 2 (concatD [prt 2 exp2, doc (showString "=>"), prt 3 exp3])
+    EOr _ exp3 exp4 -> prPrec i 3 (concatD [prt 3 exp3, doc (showString "||"), prt 4 exp4])
+    EXor _ exp4 exp5 -> prPrec i 4 (concatD [prt 4 exp4, doc (showString "xor"), prt 5 exp5])
+    EAnd _ exp5 exp6 -> prPrec i 5 (concatD [prt 5 exp5, doc (showString "&&"), prt 6 exp6])
+    ENeg _ exp7 -> prPrec i 6 (concatD [doc (showString "!"), prt 7 exp7])
+    ELt _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "<"), prt 8 exp8])
+    EGt _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString ">"), prt 8 exp8])
+    EEq _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "="), prt 8 exp8])
+    ELte _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "<="), prt 8 exp8])
+    EGte _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString ">="), prt 8 exp8])
+    ENeq _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "!="), prt 8 exp8])
+    EIn _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "in"), prt 8 exp8])
+    ENin _ exp7 exp8 -> prPrec i 7 (concatD [prt 7 exp7, doc (showString "not"), doc (showString "in"), prt 8 exp8])
+    QuantExp _ quant exp12 -> prPrec i 8 (concatD [prt 0 quant, prt 12 exp12])
+    EAdd _ exp9 exp10 -> prPrec i 9 (concatD [prt 9 exp9, doc (showString "+"), prt 10 exp10])
+    ESub _ exp9 exp10 -> prPrec i 9 (concatD [prt 9 exp9, doc (showString "-"), prt 10 exp10])
+    EMul _ exp10 exp11 -> prPrec i 10 (concatD [prt 10 exp10, doc (showString "*"), prt 11 exp11])
+    EDiv _ exp10 exp11 -> prPrec i 10 (concatD [prt 10 exp10, doc (showString "/"), prt 11 exp11])
+    ERem _ exp10 exp11 -> prPrec i 10 (concatD [prt 10 exp10, doc (showString "%"), prt 11 exp11])
+    ESumSetExp _ exp12 -> prPrec i 11 (concatD [doc (showString "sum"), prt 12 exp12])
+    EProdSetExp _ exp12 -> prPrec i 11 (concatD [doc (showString "product"), prt 12 exp12])
+    ECSetExp _ exp12 -> prPrec i 11 (concatD [doc (showString "#"), prt 12 exp12])
+    EMinExp _ exp12 -> prPrec i 11 (concatD [doc (showString "-"), prt 12 exp12])
+    EImpliesElse _ exp120 exp12 exp13 -> prPrec i 12 (concatD [doc (showString "if"), prt 12 exp120, doc (showString "then"), prt 12 exp12, doc (showString "else"), prt 13 exp13])
+    EInt _ posinteger -> prPrec i 13 (concatD [prt 0 posinteger])
+    EDouble _ posdouble -> prPrec i 13 (concatD [prt 0 posdouble])
+    EStr _ posstring -> prPrec i 13 (concatD [prt 0 posstring])
+    ESetExp _ setexp -> prPrec i 13 (concatD [prt 0 setexp])
+  prtList es = case es of
+   [] -> (concatD [])
+   x:xs -> (concatD [prt 0 x, prt 0 xs])
+
+instance Print SetExp where
+  prt i e = case e of
+    Union _ setexp setexp1 -> prPrec i 0 (concatD [prt 0 setexp, doc (showString "++"), prt 1 setexp1])
+    UnionCom _ setexp setexp1 -> prPrec i 0 (concatD [prt 0 setexp, doc (showString ","), prt 1 setexp1])
+    Difference _ setexp1 setexp2 -> prPrec i 1 (concatD [prt 1 setexp1, doc (showString "--"), prt 2 setexp2])
+    Intersection _ setexp2 setexp3 -> prPrec i 2 (concatD [prt 2 setexp2, doc (showString "**"), prt 3 setexp3])
+    Domain _ setexp3 setexp4 -> prPrec i 3 (concatD [prt 3 setexp3, doc (showString "<:"), prt 4 setexp4])
+    Range _ setexp4 setexp5 -> prPrec i 4 (concatD [prt 4 setexp4, doc (showString ":>"), prt 5 setexp5])
+    Join _ setexp5 setexp6 -> prPrec i 5 (concatD [prt 5 setexp5, doc (showString "."), prt 6 setexp6])
+    ClaferId _ name -> prPrec i 6 (concatD [prt 0 name])
+
+instance Print Decl where
+  prt i e = case e of
+    Decl _ locids setexp -> prPrec i 0 (concatD [prt 0 locids, doc (showString ":"), prt 0 setexp])
+
+instance Print Quant where
+  prt i e = case e of
+    QuantNo _ -> prPrec i 0 (concatD [doc (showString "no")])
+    QuantNot _ -> prPrec i 0 (concatD [doc (showString "not")])
+    QuantLone _ -> prPrec i 0 (concatD [doc (showString "lone")])
+    QuantOne _ -> prPrec i 0 (concatD [doc (showString "one")])
+    QuantSome _ -> prPrec i 0 (concatD [doc (showString "some")])
+
+instance Print EnumId where
+  prt i e = case e of
+    EnumIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
+  prtList es = case es of
+   [x] -> (concatD [prt 0 x])
+   x:xs -> (concatD [prt 0 x, doc (showString "|"), prt 0 xs])
+
+instance Print ModId where
+  prt i e = case e of
+    ModIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
+  prtList es = case es of
+   [x] -> (concatD [prt 0 x])
+   x:xs -> (concatD [prt 0 x, doc (showString "\\"), prt 0 xs])
+
+instance Print LocId where
+  prt i e = case e of
+    LocIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
+  prtList es = case es of
+   [x] -> (concatD [prt 0 x])
+   x:xs -> (concatD [prt 0 x, doc (showString ";"), prt 0 xs])
+
+
diff --git a/src/Language/Clafer/Front/Printclafer.hs b/src/Language/Clafer/Front/Printclafer.hs
deleted file mode 100644
--- a/src/Language/Clafer/Front/Printclafer.hs
+++ /dev/null
@@ -1,309 +0,0 @@
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
-module Language.Clafer.Front.Printclafer where
-
--- pretty-printer generated by the BNF converter
-
-import Language.Clafer.Front.Absclafer
-import Data.Char
-import Prelude hiding (exp, init)
-
-
--- the top-level printing method
-printTree :: Print a => a -> String
-printTree = render . prt 0
-
-type Doc = [ShowS] -> [ShowS]
-
-doc :: ShowS -> Doc
-doc = (:)
-
-render :: Doc -> String
-render d = rend 0 (map ($ "") $ d []) "" where
-  rend i ss = case ss of
-    "["      :ts -> showChar '[' . rend i ts
-    "("      :ts -> showChar '(' . rend i ts
-    "{"      :ts -> showChar '{' . new (i+1) . rend (i+1) ts
-    "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts
-    "}"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts
-    ";"      :ts -> showChar ';' . new i . rend i ts
-    t  : "," :ts -> showString t . space "," . rend i ts
-    t  : ")" :ts -> showString t . showChar ')' . rend i ts
-    t  : "]" :ts -> showString t . showChar ']' . rend i ts
-    t        :ts -> space t . rend i ts
-    _            -> id
-  new i   = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
-  space t = showString t . (\s -> if null s then "" else (' ':s))
-
-parenth :: Doc -> Doc
-parenth ss = doc (showChar '(') . ss . doc (showChar ')')
-
-concatS :: [ShowS] -> ShowS
-concatS = foldr (.) id
-
-concatD :: [Doc] -> Doc
-concatD = foldr (.) id
-
-replicateS :: Int -> ShowS -> ShowS
-replicateS n f = concatS (replicate n f)
-
--- the printer class does the job
-class Print a where
-  prt :: Int -> a -> Doc
-  prtList :: [a] -> Doc
-  prtList = concatD . map (prt 0)
-
-instance Print a => Print [a] where
-  prt _ = prtList
-
-instance Print Char where
-  prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'')
-  prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"')
-
-mkEsc :: Char -> Char -> ShowS
-mkEsc q s = case s of
-  _ | s == q -> showChar '\\' . showChar s
-  '\\'-> showString "\\\\"
-  '\n' -> showString "\\n"
-  '\t' -> showString "\\t"
-  _ -> showChar s
-
-prPrec :: Int -> Int -> Doc -> Doc
-prPrec i j = if j<i then parenth else id
-
-
-instance Print Integer where
-  prt _ x = doc (shows x)
-
-
-instance Print Double where
-  prt _ x = doc (shows x)
-
-
-
-instance Print PosInteger where
-  prt _ (PosInteger (_,i)) = doc (showString ( i))
-
-
-instance Print PosDouble where
-  prt _ (PosDouble (_,i)) = doc (showString ( i))
-
-
-instance Print PosString where
-  prt _ (PosString (_,i)) = doc (showString ( i))
-
-
-instance Print PosIdent where
-  prt _ (PosIdent (_,i)) = doc (showString ( i))
-
-
-
-instance Print Module where
-  prt i e = case e of
-   Module _ declarations -> prPrec i 0 (concatD [prt 0 declarations])
-
-
-instance Print Declaration where
-  prt i e = case e of
-   EnumDecl _ posident enumids -> prPrec i 0 (concatD [doc (showString "enum") , prt 0 posident , doc (showString "=") , prt 0 enumids])
-   ElementDecl _ element -> prPrec i 0 (concatD [prt 0 element])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
-
-instance Print Clafer where
-  prt i e = case e of
-   Clafer _ abstract gcard posident super reference card init elements -> prPrec i 0 (concatD [prt 0 abstract , prt 0 gcard , prt 0 posident , prt 0 super , prt 0 reference , prt 0 card , prt 0 init , prt 0 elements])
-
-
-instance Print Constraint where
-  prt i e = case e of
-   Constraint _ exps -> prPrec i 0 (concatD [doc (showString "[") , prt 0 exps , doc (showString "]")])
-
-
-instance Print SoftConstraint where
-  prt i e = case e of
-   SoftConstraint _ exps -> prPrec i 0 (concatD [doc (showString "assert") , doc (showString "[") , prt 0 exps , doc (showString "]")])
-
-
-instance Print Goal where
-  prt i e = case e of
-   Goal _ exps -> prPrec i 0 (concatD [doc (showString "<<") , prt 0 exps , doc (showString ">>")])
-
-
-instance Print Abstract where
-  prt i e = case e of
-   AbstractEmpty _  -> prPrec i 0 (concatD [])
-   Abstract _  -> prPrec i 0 (concatD [doc (showString "abstract")])
-
-
-instance Print Elements where
-  prt i e = case e of
-   ElementsEmpty _  -> prPrec i 0 (concatD [])
-   ElementsList _ elements -> prPrec i 0 (concatD [doc (showString "{") , prt 0 elements , doc (showString "}")])
-
-
-instance Print Element where
-  prt i e = case e of
-   Subclafer _ clafer -> prPrec i 0 (concatD [prt 0 clafer])
-   ClaferUse _ name card elements -> prPrec i 0 (concatD [doc (showString "`") , prt 0 name , prt 0 card , prt 0 elements])
-   Subconstraint _ constraint -> prPrec i 0 (concatD [prt 0 constraint])
-   Subgoal _ goal -> prPrec i 0 (concatD [prt 0 goal])
-   Subsoftconstraint _ softconstraint -> prPrec i 0 (concatD [prt 0 softconstraint])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
-
-instance Print Super where
-  prt i e = case e of
-   SuperEmpty _  -> prPrec i 0 (concatD [])
-   SuperSome _ setexp -> prPrec i 0 (concatD [doc (showString ":") , prt 0 setexp])
-
-
-instance Print Reference where
-  prt i e = case e of
-   ReferenceEmpty _  -> prPrec i 0 (concatD [])
-   ReferenceSet _ setexp -> prPrec i 0 (concatD [doc (showString "->") , prt 0 setexp])
-   ReferenceBag _ setexp -> prPrec i 0 (concatD [doc (showString "->>") , prt 0 setexp])
-
-
-instance Print Init where
-  prt i e = case e of
-   InitEmpty _  -> prPrec i 0 (concatD [])
-   InitSome _ inithow exp -> prPrec i 0 (concatD [prt 0 inithow , prt 0 exp])
-
-
-instance Print InitHow where
-  prt i e = case e of
-   InitConstant _  -> prPrec i 0 (concatD [doc (showString "=")])
-   InitDefault _  -> prPrec i 0 (concatD [doc (showString ":=")])
-
-
-instance Print GCard where
-  prt i e = case e of
-   GCardEmpty _  -> prPrec i 0 (concatD [])
-   GCardXor _  -> prPrec i 0 (concatD [doc (showString "xor")])
-   GCardOr _  -> prPrec i 0 (concatD [doc (showString "or")])
-   GCardMux _  -> prPrec i 0 (concatD [doc (showString "mux")])
-   GCardOpt _  -> prPrec i 0 (concatD [doc (showString "opt")])
-   GCardInterval _ ncard -> prPrec i 0 (concatD [prt 0 ncard])
-
-
-instance Print Card where
-  prt i e = case e of
-   CardEmpty _  -> prPrec i 0 (concatD [])
-   CardLone _  -> prPrec i 0 (concatD [doc (showString "?")])
-   CardSome _  -> prPrec i 0 (concatD [doc (showString "+")])
-   CardAny _  -> prPrec i 0 (concatD [doc (showString "*")])
-   CardNum _ posinteger -> prPrec i 0 (concatD [prt 0 posinteger])
-   CardInterval _ ncard -> prPrec i 0 (concatD [prt 0 ncard])
-
-
-instance Print NCard where
-  prt i e = case e of
-   NCard _ posinteger exinteger -> prPrec i 0 (concatD [prt 0 posinteger , doc (showString "..") , prt 0 exinteger])
-
-
-instance Print ExInteger where
-  prt i e = case e of
-   ExIntegerAst _  -> prPrec i 0 (concatD [doc (showString "*")])
-   ExIntegerNum _ posinteger -> prPrec i 0 (concatD [prt 0 posinteger])
-
-
-instance Print Name where
-  prt i e = case e of
-   Path _ modids -> prPrec i 0 (concatD [prt 0 modids])
-
-
-instance Print Exp where
-  prt i e = case e of
-   DeclAllDisj _ decl exp -> prPrec i 0 (concatD [doc (showString "all") , doc (showString "disj") , prt 0 decl , doc (showString "|") , prt 0 exp])
-   DeclAll _ decl exp -> prPrec i 0 (concatD [doc (showString "all") , prt 0 decl , doc (showString "|") , prt 0 exp])
-   DeclQuantDisj _ quant decl exp -> prPrec i 0 (concatD [prt 0 quant , doc (showString "disj") , prt 0 decl , doc (showString "|") , prt 0 exp])
-   DeclQuant _ quant decl exp -> prPrec i 0 (concatD [prt 0 quant , prt 0 decl , doc (showString "|") , prt 0 exp])
-   EGMax _ exp -> prPrec i 1 (concatD [doc (showString "max") , prt 2 exp])
-   EGMin _ exp -> prPrec i 1 (concatD [doc (showString "min") , prt 2 exp])
-   EIff _ exp0 exp -> prPrec i 1 (concatD [prt 1 exp0 , doc (showString "<=>") , prt 2 exp])
-   EImplies _ exp0 exp -> prPrec i 2 (concatD [prt 2 exp0 , doc (showString "=>") , prt 3 exp])
-   EOr _ exp0 exp -> prPrec i 3 (concatD [prt 3 exp0 , doc (showString "||") , prt 4 exp])
-   EXor _ exp0 exp -> prPrec i 4 (concatD [prt 4 exp0 , doc (showString "xor") , prt 5 exp])
-   EAnd _ exp0 exp -> prPrec i 5 (concatD [prt 5 exp0 , doc (showString "&&") , prt 6 exp])
-   ENeg _ exp -> prPrec i 6 (concatD [doc (showString "!") , prt 7 exp])
-   ELt _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "<") , prt 8 exp])
-   EGt _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString ">") , prt 8 exp])
-   EEq _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "=") , prt 8 exp])
-   ELte _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "<=") , prt 8 exp])
-   EGte _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString ">=") , prt 8 exp])
-   ENeq _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "!=") , prt 8 exp])
-   EIn _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "in") , prt 8 exp])
-   ENin _ exp0 exp -> prPrec i 7 (concatD [prt 7 exp0 , doc (showString "not") , doc (showString "in") , prt 8 exp])
-   QuantExp _ quant exp -> prPrec i 8 (concatD [prt 0 quant , prt 12 exp])
-   EAdd _ exp0 exp -> prPrec i 9 (concatD [prt 9 exp0 , doc (showString "+") , prt 10 exp])
-   ESub _ exp0 exp -> prPrec i 9 (concatD [prt 9 exp0 , doc (showString "-") , prt 10 exp])
-   EMul _ exp0 exp -> prPrec i 10 (concatD [prt 10 exp0 , doc (showString "*") , prt 11 exp])
-   EDiv _ exp0 exp -> prPrec i 10 (concatD [prt 10 exp0 , doc (showString "/") , prt 11 exp])
-   ESumSetExp _ exp -> prPrec i 11 (concatD [doc (showString "sum") , prt 12 exp])
-   ECSetExp _ exp -> prPrec i 11 (concatD [doc (showString "#") , prt 12 exp])
-   EMinExp _ exp -> prPrec i 11 (concatD [doc (showString "-") , prt 12 exp])
-   EImpliesElse _ exp0 exp1 exp -> prPrec i 12 (concatD [doc (showString "if") , prt 12 exp0 , doc (showString "then") , prt 12 exp1 , doc (showString "else") , prt 13 exp])
-   EInt _ posinteger -> prPrec i 13 (concatD [prt 0 posinteger])
-   EDouble _ posdouble -> prPrec i 13 (concatD [prt 0 posdouble])
-   EStr _ posstring -> prPrec i 13 (concatD [prt 0 posstring])
-   ESetExp _ setexp -> prPrec i 13 (concatD [prt 0 setexp])
-
-  prtList es = case es of
-   [] -> (concatD [])
-   x:xs -> (concatD [prt 0 x , prt 0 xs])
-
-instance Print SetExp where
-  prt i e = case e of
-   Union _ setexp0 setexp -> prPrec i 0 (concatD [prt 0 setexp0 , doc (showString "++") , prt 1 setexp])
-   UnionCom _ setexp0 setexp -> prPrec i 0 (concatD [prt 0 setexp0 , doc (showString ",") , prt 1 setexp])
-   Difference _ setexp0 setexp -> prPrec i 1 (concatD [prt 1 setexp0 , doc (showString "--") , prt 2 setexp])
-   Intersection _ setexp0 setexp -> prPrec i 2 (concatD [prt 2 setexp0 , doc (showString "**") , prt 3 setexp])
-   Domain _ setexp0 setexp -> prPrec i 3 (concatD [prt 3 setexp0 , doc (showString "<:") , prt 4 setexp])
-   Range _ setexp0 setexp -> prPrec i 4 (concatD [prt 4 setexp0 , doc (showString ":>") , prt 5 setexp])
-   Join _ setexp0 setexp -> prPrec i 5 (concatD [prt 5 setexp0 , doc (showString ".") , prt 6 setexp])
-   ClaferId _ name -> prPrec i 6 (concatD [prt 0 name])
-
-
-instance Print Decl where
-  prt i e = case e of
-   Decl _ locids setexp -> prPrec i 0 (concatD [prt 0 locids , doc (showString ":") , prt 0 setexp])
-
-
-instance Print Quant where
-  prt i e = case e of
-   QuantNo _  -> prPrec i 0 (concatD [doc (showString "no")])
-   QuantNot _  -> prPrec i 0 (concatD [doc (showString "not")])
-   QuantLone _  -> prPrec i 0 (concatD [doc (showString "lone")])
-   QuantOne _  -> prPrec i 0 (concatD [doc (showString "one")])
-   QuantSome _  -> prPrec i 0 (concatD [doc (showString "some")])
-
-
-instance Print EnumId where
-  prt i e = case e of
-   EnumIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
-
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString "|") , prt 0 xs])
-
-instance Print ModId where
-  prt i e = case e of
-   ModIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
-
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString "\\") , prt 0 xs])
-
-instance Print LocId where
-  prt i e = case e of
-   LocIdIdent _ posident -> prPrec i 0 (concatD [prt 0 posident])
-
-  prtList es = case es of
-   [x] -> (concatD [prt 0 x])
-   x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])
-
-
diff --git a/src/Language/Clafer/Generator/Alloy.hs b/src/Language/Clafer/Generator/Alloy.hs
--- a/src/Language/Clafer/Generator/Alloy.hs
+++ b/src/Language/Clafer/Generator/Alloy.hs
@@ -21,7 +21,7 @@
  SOFTWARE.
 -}
 -- | Generates Alloy4.1 or 4.2 code for a Clafer model
-module Language.Clafer.Generator.Alloy where
+module Language.Clafer.Generator.Alloy (genModule) where
 
 import Control.Applicative ((<$>))
 import Control.Lens hiding (elements, mapping)
@@ -31,59 +31,69 @@
 
 import Language.Clafer.Common
 import Language.Clafer.ClaferArgs
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Generator.Concat
 import Language.Clafer.Intermediate.Intclafer hiding (exp)
 
+
+data GenEnv = GenEnv
+  { claferargs :: ClaferArgs
+  , uidIClaferMap :: UIDIClaferMap
+  , forScopes :: String
+  }  deriving (Show)
+
+
 -- | Alloy code generation
 -- 07th Mayo 2012 Rafael Olaechea
 --      Added Logic to print a goal block in case there is at least one goal.
 genModule :: ClaferArgs -> (IModule, GEnv) -> [(UID, Integer)] -> (Result, [(Span, IrTrace)])
-genModule    claferargs    (imodule, _)       scopes           = (flatten output, filter ((/= NoTrace) . snd) $ mapLineCol output)
+genModule    claferargs'   (imodule, genv)    scopes            = (flatten output, filter ((/= NoTrace) . snd) $ mapLineCol output)
   where
-  output = header claferargs scopes +++ (cconcat $ map (genDeclaration claferargs) (_mDecls imodule)) +++
-       if ((not $ skip_goals claferargs) && length goals_list > 0) then
+
+  genScopes :: [(UID, Integer)] -> String
+  genScopes    []                = ""
+  genScopes    scopes'           = " but " ++ intercalate ", " (map (\ (uid', scope)  -> show scope ++ " " ++ uid') scopes')
+
+  forScopes' = "for 1" ++ genScopes scopes
+  genEnv = GenEnv claferargs' (uidClaferMap genv) forScopes'
+  output = header genEnv +++ (cconcat $ map (genDeclaration genEnv) (_mDecls imodule)) +++
+       if ((not $ skip_goals claferargs') && length goals_list > 0) then
                 CString "objectives o_global {\n" +++   (cintercalate (CString ",\n") goals_list) +++   CString "\n}"
        else
                 CString ""
        where
-                goals_list = filterNull (map (genDeclarationGoalsOnly claferargs) (_mDecls imodule))
+                goals_list = filterNull (map (genDeclarationGoalsOnly genEnv) (_mDecls imodule))
 
-header :: ClaferArgs -> [(UID, Integer)] -> Concat
-header    args          scopes       = CString $ unlines
+header :: GenEnv -> Concat
+header    genEnv  = CString $ unlines
     [ "open util/integer"
     , "pred show {}"
-    , if (validate args) ||  (noalloyruncommand args)
+    , if (validate $ claferargs genEnv) ||  (noalloyruncommand $ claferargs genEnv)
       then ""
-      else "run show for 1" ++ genScopes scopes
+      else "run show " ++ forScopes genEnv
     , ""]
-    where
-    genScopes [] = ""
-    genScopes scopes' = " but " ++ intercalate ", " (map genScope scopes')
 
-genScope :: (UID, Integer) -> String
-genScope    (uid', scope)       = show scope ++ " " ++ uid'
 
-
 -- 07th Mayo 2012 Rafael Olaechea
 -- Modified so that we can collect all goals into a single block as required per the way goals are handled in modified alloy.
-genDeclarationGoalsOnly :: ClaferArgs -> IElement -> Concat
-genDeclarationGoalsOnly    claferargs    x         = case x of
+genDeclarationGoalsOnly :: GenEnv -> IElement -> Concat
+genDeclarationGoalsOnly    genEnv    x         = case x of
   IEClafer _  -> CString ""
   IEConstraint _ _  -> CString ""
   IEGoal _ (PExp _ _ _ innerexp) -> case innerexp of
         IFunExp op'  exps' ->  if  op' == iGMax || op' == iGMin then
-                        mkMetric op' $ genPExp claferargs [] (head exps')
+                        mkMetric op' $ genPExp genEnv [] (head exps')
                 else
                         error "unary operator  distinct from (min/max) at the topmost level of a goal element"
         _ ->  error "no unary operator (min/max) at the topmost level of a goal element."
 
 -- 07th Mayo 2012 Rafael Olaechea
 -- Removed goal from this function as they will now  all be collected into a single block.
-genDeclaration :: ClaferArgs -> IElement -> Concat
-genDeclaration claferargs x = case x of
-  IEClafer clafer'  -> (genClafer claferargs [] clafer') +++ (mkFact $ cconcat $ genSetUniquenessConstraint clafer')
-  IEConstraint _ pexp  -> mkFact $ genPExp claferargs [] pexp
+genDeclaration :: GenEnv -> IElement -> Concat
+genDeclaration genEnv x = case x of
+  IEClafer clafer'  -> (genClafer genEnv [] clafer') +++ (mkFact $ cconcat $ genSetUniquenessConstraint clafer')
+  IEConstraint True pexp  -> mkFact $ genPExp genEnv [] pexp
+  IEConstraint False pexp  -> mkAssert genEnv (genAssertName pexp) $ genPExp genEnv [] pexp
   IEGoal _ (PExp _ _ _ innerexp) -> case innerexp of
         IFunExp op'  _ ->  if  op' == iGMax || op' == iGMin then
                        CString ""
@@ -95,6 +105,20 @@
 mkFact x@(CString "") = x
 mkFact xs = cconcat [CString "fact ", mkSet xs, CString "\n"]
 
+genAssertName :: PExp -> Concat
+genAssertName    PExp{_inPos=(Span _ (Pos line _))} = CString $ "assertOnLine_" ++ show line
+
+mkAssert :: GenEnv -> Concat -> Concat        -> Concat
+mkAssert    _         _         x@(CString "") = x
+mkAssert    genEnv    name      xs = cconcat
+  [ CString "assert ", name, CString " "
+  , mkSet xs
+  , CString "\n"
+  , CString "check ", name, CString " "
+  , CString $ forScopes genEnv
+  , CString "\n\n"
+  ]
+
 mkMetric :: String -> Concat -> Concat
 mkMetric goalopname xs = cconcat [ if goalopname == iGMax then CString "maximize" else  CString "minimize", CString " ", xs, CString " "]
 
@@ -113,13 +137,13 @@
 
 -- optimization: top level cardinalities
 -- optimization: if only boolean parents, then set card is known
-genClafer :: ClaferArgs -> [String] -> IClafer -> Concat
-genClafer claferargs resPath clafer'
+genClafer :: GenEnv -> [String] -> IClafer -> Concat
+genClafer genEnv resPath clafer'
   = (cunlines $ filterNull
       [   cardFact
       +++ claferDecl clafer' (
-          (showSet (CString "\n, ") $ genRelations claferargs clafer')
-          +++ (optShowSet $ filterNull $ genConstraints claferargs resPath clafer')
+          (showSet (CString "\n, ") $ genRelations genEnv clafer')
+          +++ (optShowSet $ filterNull $ genConstraints genEnv resPath clafer')
         )
       ]
     )
@@ -127,7 +151,7 @@
   +++ children'
   where
   children' = cconcat $ filterNull $ map
-             (genClafer claferargs ((_uid clafer') : resPath)) $
+             (genClafer genEnv ((_uid clafer') : resPath)) $
              getSubclafers $ _elements clafer'
   cardFact
     | null resPath && (null $ flatten $ genOptCard clafer') =
@@ -163,14 +187,14 @@
 -- relations: overlapping inheritance (val rel), children
 -- adds parent relation
 -- 29/March/2012  Rafael Olaechea: ref is now prepended with clafer name to be able to refer to it from partial instances.
-genRelations :: ClaferArgs -> IClafer -> [Concat]
-genRelations claferargs c = maybeToList r ++ (map mkRel $ getSubclafers $ _elements c)
+genRelations :: GenEnv -> IClafer -> [Concat]
+genRelations genEnv c = maybeToList r ++ (map mkRel $ getSubclafers $ _elements c)
   where
   r = if isJust $ _reference c
                 then
-                        Just $ Concat NoTrace [CString $ genRel (if (noalloyruncommand claferargs) then  (_uid c ++ "_ref") else "ref")
+                        Just $ Concat NoTrace [CString $ genRel (if (noalloyruncommand $ claferargs genEnv) then  (_uid c ++ "_ref") else "ref")
                          c {_card = Just (1, 1)} $
-                         flatten $ refType claferargs c]
+                         flatten $ refType genEnv c]
                 else
                         Nothing
   mkRel c' = Concat NoTrace [CString $ genRel (genRelName $ _uid c') c' $ _uid c']
@@ -186,8 +210,8 @@
 genAlloyRel :: String -> String -> String -> String
 genAlloyRel name card' rType = concat [name, " : ", card', " ", rType]
 
-refType :: ClaferArgs -> IClafer -> Concat
-refType claferargs c = fromMaybe (CString "") $ fmap ((genType claferargs).getTarget) $ _ref <$> _reference c
+refType :: GenEnv -> IClafer -> Concat
+refType    genEnv c = fromMaybe (CString "") $ fmap ((genType genEnv).getTarget) $ _ref <$> _reference c
 
 
 getTarget :: PExp -> PExp
@@ -195,8 +219,8 @@
   PExp _ _ _ (IFunExp op' (_:pexp:_))  -> if op' == iJoin then pexp else x
   _ -> x
 
-genType :: ClaferArgs -> PExp                              -> Concat
-genType    claferargs    x@(PExp _ _ _ y@(IClaferId _ _ _ _)) = genPExp claferargs []
+genType :: GenEnv -> PExp                              -> Concat
+genType    genEnv    x@(PExp _ _ _ y@(IClaferId _ _ _ _)) = genPExp genEnv []
   x{_exp = y{_isTop = True}}
 genType m x = genPExp m [] x
 
@@ -205,21 +229,39 @@
 -- constraints
 -- parent + group constraints + reference + user constraints
 -- a = NUMBER do all x : a | x = NUMBER (otherwise alloy sums a set)
-genConstraints :: ClaferArgs -> [String]      -> IClafer -> [Concat]
-genConstraints    cargs    resPath c
+genConstraints :: GenEnv -> [String]      -> IClafer -> [Concat]
+genConstraints    genEnv    resPath c
   = (genParentConst resPath c)
-  : (genGroupConst c)
-  : genPathConst cargs  (if (noalloyruncommand cargs) then  (_uid c ++ "_ref") else "ref") resPath c
+  : (genGroupConst genEnv c)
+{- genPathConst produces incorrect code for top-level clafers
+
+abstract System
+    abstract Connection
+    connections -> Connection *
+
+sig c0_connections
+{ ref : one c0_Connection }
+{ one @r_c0_connections.this
+  ref = (@r_c0_System.@r_c0_Connection) }
+
+r_c0_System does not exist because System is top-level. The constraint is useless anyway, since all instances
+of Connection are nested under all Systems anyway.
+  disabled code:
+  : genPathConst genEnv  (if (noalloyruncommand $ claferargs genEnv) then  (_uid c ++ "_ref") else "ref") resPath c
+-}
   : constraints
   where
   constraints = concat $ map genConst $ _elements c
   genConst x = case x of
-    IEConstraint _ pexp  -> [ genPExp cargs ((_uid c) : resPath) pexp ]
+    IEConstraint True pexp  -> [ genPExp genEnv ((_uid c) : resPath) pexp ]
+    IEConstraint False pexp  -> [ CString "// Assertion " +++ (genAssertName pexp) +++ CString " ignored since nested assertions are not supported in Alloy.\n"]
     IEClafer c' ->
         (if genCardCrude (_card c') `elem` ["one", "lone", "some"]
          then CString ""
          else mkCard ({- do not use the genRelName as the constraint name -} _uid c') False (genRelName $ _uid c') $ fromJust (_card c')
-        ) : genSetUniquenessConstraint c'
+        )
+        : (genParentSubrelationConstriant (uidIClaferMap genEnv) c')
+        : (genSetUniquenessConstraint c')
     IEGoal _ _ -> error "getConst function from Alloy generator was given a Goal, this function should only be given a Constrain or Clafer" -- This should never happen
 
 
@@ -240,6 +282,21 @@
       _ -> []
     )
 
+genParentSubrelationConstriant :: UIDIClaferMap -> IClafer   -> Concat
+genParentSubrelationConstriant    uidIClaferMap'        headClafer =
+  case match of
+    Nothing -> CString ""
+    Just NestedInheritanceMatch {
+           _superClafer = superClafer
+         }  -> if (isProperNesting uidIClaferMap' match) && (not $ isTopLevel superClafer)
+               then CString $ concat
+                [ genRelName $ _uid headClafer
+                , " in "
+                , genRelName $ _uid superClafer
+                ]
+               else CString ""
+  where
+    match = matchNestedInheritance uidIClaferMap' headClafer
 
 -- optimization: if only boolean features then the parent is unique
 genParentConst :: [String] -> IClafer -> Concat
@@ -258,13 +315,15 @@
   rel = genRelName $ _uid c
   glCard' = genIntervalCrude $ _glCard c
 
-genGroupConst :: IClafer -> Concat
-genGroupConst    clafer'
-  | null children' || flatten card' == "" = CString ""
+genGroupConst :: GenEnv -> IClafer -> Concat
+genGroupConst    genEnv    clafer'
+  | _isAbstract clafer' || null children' || flatten card' == "" = CString ""
   | otherwise = cconcat [CString "let children = ", brArg id $ CString children', CString" | ", card']
   where
+  superHierarchy :: [IClafer]
+  superHierarchy = findHierarchy getSuper (uidIClaferMap genEnv) clafer'
   children' = intercalate " + " $ map (genRelName._uid) $
-             getSubclafers $ _elements clafer'
+             getSubclafers $ concatMap _elements superHierarchy
   card'     = mkCard (_uid clafer') True "children" $ _interval $ fromJust $ _gcard $ clafer'
 
 mkCard :: String -> Bool -> String -> (Integer, Integer) -> Concat
@@ -277,11 +336,11 @@
   crd'  = flatten $ interval'
 
 -- generates expression for references that point to expressions (not single clafers)
-genPathConst :: ClaferArgs -> String -> [String] -> IClafer -> Concat
-genPathConst    claferargs    name      resPath     c
+genPathConst :: GenEnv -> String -> [String] -> IClafer -> Concat
+genPathConst    genEnv    name      resPath     c
   | isRefPath (c ^. reference) = cconcat [CString name, CString " = ",
                                 fromMaybe (error "genPathConst: impossible.") $
-                                fmap ((brArg id).(genPExp claferargs resPath)) $
+                                fmap ((brArg id).(genPExp genEnv resPath)) $
                                 _ref <$> _reference c]
   | otherwise        = CString ""
 
@@ -356,15 +415,15 @@
 -- -----------------------------------------------------------------------------
 -- Generate code for logical expressions
 
-genPExp :: ClaferArgs -> [String] -> PExp -> Concat
-genPExp    claferargs    resPath     x     = genPExp' claferargs resPath $ adjustPExp resPath x
+genPExp :: GenEnv -> [String] -> PExp -> Concat
+genPExp    genEnv    resPath     x     = genPExp' genEnv resPath $ adjustPExp resPath x
 
-genPExp' :: ClaferArgs -> [String] -> PExp                      -> Concat
-genPExp'    claferargs    resPath     (PExp iType' pid' pos exp') = case exp' of
+genPExp' :: GenEnv -> [String] -> PExp                      -> Concat
+genPExp'    genEnv    resPath     (PExp iType' pid' pos exp') = case exp' of
   IDeclPExp q d pexp -> Concat (IrPExp pid') $
     [ CString $ genQuant q, CString " "
-    , cintercalate (CString ", ") $ map ((genDecl claferargs resPath)) d
-    , CString $ optBar d, genPExp' claferargs resPath pexp]
+    , cintercalate (CString ", ") $ map ((genDecl genEnv resPath)) d
+    , CString $ optBar d, genPExp' genEnv resPath pexp]
     where
     optBar [] = ""
     optBar _  = " | "
@@ -380,11 +439,11 @@
     sid' = (if istop then "" else '@' : genRelName "") ++ sid
     -- 29/March/2012  Rafael Olaechea: ref is now prepended with clafer name to be able to refer to it from partial instances.
     -- 30/March/2012 Rafael Olaechea added referredClaferUniqeuid to fix problems when having this.x > number  (e.g test/positive/i10.cfr )
-    vsident = if (noalloyruncommand claferargs) then sid' ++  ".@"  ++ referredClaferUniqeuid ++ "_ref"  else  sid'  ++ ".@ref"
+    vsident = if (noalloyruncommand $ claferargs genEnv) then sid' ++  ".@"  ++ referredClaferUniqeuid ++ "_ref"  else  sid'  ++ ".@ref"
         where referredClaferUniqeuid = if sid == "this" then (head resPath) else sid
   IFunExp _ _ -> case exp'' of
-    IFunExp _ _ -> genIFunExp pid' claferargs resPath exp''
-    _ -> genPExp' claferargs resPath $ PExp iType' pid' pos exp''
+    IFunExp _ _ -> genIFunExp pid' genEnv resPath exp''
+    _ -> genPExp' genEnv resPath $ PExp iType' pid' pos exp''
     where
     exp'' = transformExp exp'
   IInt n -> CString $ show n
@@ -407,24 +466,24 @@
   | otherwise  = x
 transformExp x = x
 
-genIFunExp :: String -> ClaferArgs -> [String] -> IExp             -> Concat
-genIFunExp    pid'       claferargs    resPath     (IFunExp op' exps') =
+genIFunExp :: String -> GenEnv -> [String] -> IExp             -> Concat
+genIFunExp    pid'      genEnv    resPath     (IFunExp op' exps') =
   if (op' == iSumSet)
-    then genIFunExp pid' claferargs resPath (IFunExp iSumSet' [(removeright (head exps')), (getRight $ head exps')])
+    then genIFunExp pid' genEnv resPath (IFunExp iSumSet' [(removeright (head exps')), (getRight $ head exps')])
     else if (op' == iSumSet')
-      then Concat (IrPExp pid') $ intl exps'' (map CString $ genOp (Alloy42 `elem` (mode claferargs)) iSumSet)
-      else Concat (IrPExp pid') $ intl exps'' (map CString $ genOp (Alloy42 `elem` (mode claferargs)) op')
+      then Concat (IrPExp pid') $ intl exps'' (map CString $ genOp (Alloy42 `elem` (mode $ claferargs genEnv)) iSumSet)
+      else Concat (IrPExp pid') $ intl exps'' (map CString $ genOp (Alloy42 `elem` (mode $ claferargs genEnv)) op')
   where
   intl
     | op' == iSumSet' = flip $ interleave
     | op' `elem` arithBinOps && length exps' == 2 = interleave
     | otherwise = \xs ys -> reverse $ interleave (reverse xs) (reverse ys)
-  exps'' = map (optBrArg claferargs resPath) exps'
+  exps'' = map (optBrArg genEnv resPath) exps'
 genIFunExp _ _ _ _ = error "Function genIFunExp from Alloy Generator expected a IFunExp as an argument but was given something else" --This should never happen
 
 
-optBrArg :: ClaferArgs -> [String] -> PExp -> Concat
-optBrArg    claferargs    resPath     x     = brFun (genPExp' claferargs resPath) x
+optBrArg :: GenEnv -> [String] -> PExp -> Concat
+optBrArg    genEnv    resPath     x     = brFun (genPExp' genEnv resPath) x
   where
   brFun = case x of
     PExp _ _ _ (IClaferId _ _ _ _) -> ($)
@@ -448,11 +507,13 @@
   | otherwise   = genOp False op'
 genOp    _             op'
   | op' == iSumSet = ["sum temp : "," | temp."]
+  | op' == iProdSet = ["prod temp : "," | temp."]
   | op' `elem` unOps  = [op']
   | op' == iPlus = [".add[", "]"]
   | op' == iSub  = [".sub[", "]"]
   | op' == iMul = [".mul[", "]"]
   | op' == iDiv = [".div[", "]"]
+  | op' == iRem = [".rem[", "]"]
   | op' `elem` logBinOps ++ relBinOps ++ arithBinOps = [" " ++ op' ++ " "]
   | op' == iUnion = [" + "]
   | op' == iDifference = [" - "]
@@ -502,10 +563,10 @@
   IAll -> "all"
 
 
-genDecl :: ClaferArgs -> [String] -> IDecl -> Concat
-genDecl    claferargs    resPath     x      = case x of
+genDecl :: GenEnv -> [String] -> IDecl -> Concat
+genDecl    genEnv    resPath     x      = case x of
   IDecl disj locids pexp -> cconcat [CString $ genDisj disj, CString " ",
-    CString $ intercalate ", " locids, CString " : ", genPExp claferargs resPath pexp]
+    CString $ intercalate ", " locids, CString " : ", genPExp genEnv resPath pexp]
 
 
 genDisj :: Bool -> String
diff --git a/src/Language/Clafer/Generator/Choco.hs b/src/Language/Clafer/Generator/Choco.hs
--- a/src/Language/Clafer/Generator/Choco.hs
+++ b/src/Language/Clafer/Generator/Choco.hs
@@ -12,14 +12,12 @@
 import Data.Maybe
 import Data.Ord
 import Prelude hiding (exp)
-import Language.Clafer.ClaferArgs
 import Language.Clafer.Common
-import Language.Clafer.Front.Absclafer
 import Language.Clafer.Intermediate.Intclafer
 
 -- | Choco 3 code generation
-genCModule :: ClaferArgs -> (IModule, GEnv) -> [(UID, Integer)] -> Result
-genCModule _ (imodule@IModule{_mDecls}, _) scopes =
+genCModule :: (IModule, GEnv) -> [(UID, Integer)] -> Result
+genCModule (imodule@IModule{_mDecls}, genv') scopes =
     genScopes
     ++ "\n"
     ++ (genAbstractClafer =<< abstractClafers)
@@ -29,8 +27,9 @@
     ++ (genConstraint =<< clafers)
     ++ (genGoal =<< _mDecls)
     where
+    uidIClaferMap' = uidClaferMap genv'
     root :: IClafer
-    root = IClafer noSpan False Nothing rootIdent rootIdent "" Nothing Nothing (Just (1, 1)) (0, 0) _mDecls
+    root = fromJust $ findIClafer uidIClaferMap' rootIdent
 
     toplevelClafers = mapMaybe iclafer _mDecls
     -- The sort is so that we encounter sub clafers before super clafers when abstract clafers extend other abstract clafers
@@ -40,7 +39,7 @@
     claferUids = _uid <$> clafers
     concreteClafers = filter isNotAbstract clafers
 
-    claferWithUid u = fromMaybe (error $ "claferWithUid: \"" ++ u ++ "\" is not a clafer") $ find ((== u) . _uid) clafers
+    claferWithUid u = fromMaybe (error $ "claferWithUid: \"" ++ u ++ "\" is not a clafer") $ findIClafer uidIClaferMap' u
 
     -- All abstract clafers u inherits
     supersOf :: String -> [String]
@@ -187,6 +186,10 @@
         | [arg] <- args', PExp{_exp = IFunExp{_exps = [a, PExp{_exp = IClaferId{_sident = "ref"}}]}} <- rewrite arg =
             "sum(" ++ genConstraintPExp a ++ ")"
         | otherwise = error "Choco: Unexpected sum argument."
+    genConstraintExp (IFunExp "product" args')
+        | [arg] <- args', PExp{_exp = IFunExp{_exps = [a, PExp{_exp = IClaferId{_sident = "ref"}}]}} <- rewrite arg =
+            "product(" ++ genConstraintPExp a ++ ")"
+        | otherwise = error "Choco: Unexpected product argument."
     genConstraintExp (IFunExp "+" args') =
 	(if _iType (head args') == Just TString then "concat" else "add") ++
             "(" ++ intercalate ", " (map genConstraintPExp args') ++ ")"
@@ -225,6 +228,7 @@
     mapFunc "+" = "add"
     mapFunc "*" = "mul"
     mapFunc "/" = "div"
+    mapFunc "%" = "mod"
     mapFunc "++" = "union"
     mapFunc "--" = "diff"
     mapFunc "**" = "inter"
diff --git a/src/Language/Clafer/Generator/Graph.hs b/src/Language/Clafer/Generator/Graph.hs
--- a/src/Language/Clafer/Generator/Graph.hs
+++ b/src/Language/Clafer/Generator/Graph.hs
@@ -23,7 +23,7 @@
 module Language.Clafer.Generator.Graph (genSimpleGraph, genCVLGraph, traceAstModule, traceIrModule) where
 
 import Language.Clafer.Common(fst3,snd3,trd3)
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Tracing
 import Language.Clafer.Intermediate.Intclafer
 import Language.Clafer.Generator.Html(genTooltip)
diff --git a/src/Language/Clafer/Generator/Html.hs b/src/Language/Clafer/Generator/Html.hs
--- a/src/Language/Clafer/Generator/Html.hs
+++ b/src/Language/Clafer/Generator/Html.hs
@@ -37,7 +37,7 @@
                                        highlightErrors) where
 
 import Language.ClaferT
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Front.LayoutResolver(revertLayout)
 import Language.Clafer.Intermediate.Tracing
 import Language.Clafer.Intermediate.Intclafer
@@ -154,7 +154,7 @@
 printElement (Subsoftconstraint s constraint) indent irMap html comments =
     preComments ++
     printIndent indent html ++
-    printSoftConstraint constraint indent irMap html comments'' ++
+    printAssertion constraint indent irMap html comments'' ++
     comment ++
     printIndentEnd html
   where
@@ -266,15 +266,15 @@
     " " ++
     while html "<span class=\"keyword\">" ++ "]" ++ while html "</span>"
 
-printSoftConstraint :: SoftConstraint -> Int -> Map.Map Span [Ir] -> Bool -> [(Span, String)] -> String
-printSoftConstraint (SoftConstraint _ exps') indent irMap html comments = concatMap (\x -> printSoftConstraint' x indent irMap html comments) exps'
-printSoftConstraint' :: Exp -> Int -> Map.Map Span [Ir] -> Bool -> [(Span, String)] -> String
-printSoftConstraint' exp' indent' irMap html comments =
-    while html "<span class=\"keyword\">" ++ "(" ++ while html "</span>" ++
+printAssertion :: SoftConstraint -> Int -> Map.Map Span [Ir] -> Bool -> [(Span, String)] -> String
+printAssertion (SoftConstraint _ exps') indent irMap html comments = concatMap (\x -> printAssertion' x indent irMap html comments) exps'
+printAssertion' :: Exp -> Int -> Map.Map Span [Ir] -> Bool -> [(Span, String)] -> String
+printAssertion' exp' indent' irMap html comments =
+    while html "<span class=\"keyword\">" ++ "assert [" ++ while html "</span>" ++
     " " ++
     printExp exp' indent' irMap html comments ++
     " " ++
-    while html "<span class=\"keyword\">" ++ ")" ++ while html "</span>"
+    while html "<span class=\"keyword\">" ++ "]" ++ while html "</span>"
 
 printDecl :: Decl-> Int -> Map.Map Span [Ir] -> Bool -> [(Span, String)] -> String
 printDecl (Decl _ locids setExp) indent irMap html comments =
@@ -302,24 +302,26 @@
 printExp (ENeq _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " != " ++ (printExp exp'2 indent irMap html comments)
 printExp (ESetExp _ setExp)       indent irMap html comments = printSetExp setExp indent irMap html comments
 printExp (QuantExp _ quant' exp')   indent irMap html comments = printQuant quant' html ++ printExp exp' indent irMap html comments
-printExp (EImplies _ exp'1 exp'2)   indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " => " ++ printExp exp'2 indent irMap html comments
-printExp (EAnd _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " && " ++ printExp exp'2 indent irMap html comments
-printExp (EOr _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " || " ++ printExp exp'2 indent irMap html comments
+printExp (EImplies _ exp'1 exp'2)   indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " =&gt; " else " => ") ++ printExp exp'2 indent irMap html comments
+printExp (EAnd _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &amp;&amp; " else " && ")  ++ printExp exp'2 indent irMap html comments
+printExp (EOr _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &#124;&#124; " else " || ") ++ printExp exp'2 indent irMap html comments
 printExp (EXor _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " xor " ++ printExp exp'2 indent irMap html comments
 printExp (ENeg _ exp')             indent irMap html comments = " ! " ++ printExp exp' indent irMap html comments
 printExp (ELt _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &lt; " else " < ") ++ printExp exp'2 indent irMap html comments
-printExp (EGt _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " > " ++ printExp exp'2 indent irMap html comments
+printExp (EGt _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &gt; " else " > ") ++ printExp exp'2 indent irMap html comments
 printExp (EEq _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " = " ++ printExp exp'2 indent irMap html comments
 printExp (ELte _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &lt;= " else " <= ") ++ printExp exp'2 indent irMap html comments
-printExp (EGte _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " >= " ++ printExp exp'2 indent irMap html comments
+printExp (EGte _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &gt;= " else " >= ") ++ printExp exp'2 indent irMap html comments
 printExp (EIn _ exp'1 exp'2)        indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " in " ++ printExp exp'2 indent irMap html comments
 printExp (ENin _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " not in " ++ printExp exp'2 indent irMap html comments
 printExp (EIff _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &lt;=&gt; " else " <=> ") ++ printExp exp'2 indent irMap html comments
 printExp (EAdd _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " + " ++ printExp exp'2 indent irMap html comments
 printExp (ESub _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " - " ++ printExp exp'2 indent irMap html comments
 printExp (EMul _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " * " ++ printExp exp'2 indent irMap html comments
-printExp (EDiv _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ " / " ++ printExp exp'2 indent irMap html comments
-printExp (ESumSetExp _ exp') indent irMap html comments = "sum " ++ printExp exp' indent irMap html comments
+printExp (EDiv _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &#47; " else " / ") ++ printExp exp'2 indent irMap html comments
+printExp (ERem _ exp'1 exp'2)       indent irMap html comments = (printExp exp'1 indent irMap html comments) ++ (if html then " &#37; " else " % ") ++ printExp exp'2 indent irMap html comments
+printExp (ESumSetExp _ exp')        indent irMap html comments = "sum " ++ printExp exp' indent irMap html comments
+printExp (EProdSetExp _ exp')       indent irMap html comments = "product " ++ printExp exp' indent irMap html comments
 printExp (ECSetExp _ exp')         indent irMap html comments = "# " ++ printExp exp' indent irMap html comments
 printExp (EMinExp _ exp')          indent irMap html comments = "-" ++ printExp exp' indent irMap html comments
 printExp (EImpliesElse _ exp'1 exp'2 exp'3) indent irMap html comments = "if " ++ (printExp exp'1 indent irMap html comments) ++ " then " ++ (printExp exp'2 indent irMap html comments) ++ " else " ++ (printExp exp'3 indent irMap html comments)
diff --git a/src/Language/Clafer/Generator/Python.hs b/src/Language/Clafer/Generator/Python.hs
--- a/src/Language/Clafer/Generator/Python.hs
+++ b/src/Language/Clafer/Generator/Python.hs
@@ -1,258 +1,260 @@
-{-
- Copyright (C) 2012 Kacper Bak, Jimmy Liang <http://gsd.uwaterloo.ca>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
--}
--- | Generates Python representation of IR for the <https://github.com/gsdlab/ClaferZ3 ClaferZ3>.
-module Language.Clafer.Generator.Python where
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE ViewPatterns #-}
 
-import Data.Char
-import Data.Maybe (fromMaybe)
+-- | Generates JS representation of IR for the <https://github.com/gsdlab/chocosolver Chocosolver>.
+module Language.Clafer.Generator.Python (genPythonModule) where
 
+import Control.Applicative
+import Control.Lens.Plated hiding (rewrite)
+import Control.Monad
+import Data.Data.Lens
+import Data.List
+import Data.Maybe
+import Data.Ord
+import Prelude hiding (exp)
 import Language.Clafer.Common
-import Language.Clafer.Front.Absclafer
 import Language.Clafer.Intermediate.Intclafer
 
-tag:: String -> String -> String
-tag name exp' = concat ["<", name, ">", exp', "</", name, ">\n"]
+-- | Choco 3 code generation
+genPythonModule :: (IModule, GEnv) -> [(UID, Integer)] -> Result
+genPythonModule (imodule@IModule{_mDecls}, genv') scopes =
+    genImports
+    ++ "\n"
+    ++ (genAbstractClafer =<< abstractClafers)
+    ++ (genConcreteClafer =<< concreteClafers)
+    ++ (genRefClafer =<< clafers)
+    ++ (genTopConstraint =<< _mDecls)
+    ++ (genConstraint =<< clafers)
+    ++ (genGoal =<< _mDecls)
+    ++ genScopes
+    where
+    uidIClaferMap' = uidClaferMap genv'
+    root :: IClafer
+    root = fromJust $ findIClafer uidIClaferMap' rootIdent
 
---Maybe a -> (a -> [Char]) -> [Char]
---optTag elem f = maybe "" f elem
+    toplevelClafers = mapMaybe iclafer _mDecls
+    -- The sort is so that we encounter sub clafers before super clafers when abstract clafers extend other abstract clafers
+    abstractClafers = sortBy (comparing $ length . supersOf . _uid) $ filter _isAbstract toplevelClafers
+    parentChildMap = childClafers root
+    clafers = snd <$> parentChildMap
+    claferUids = _uid <$> clafers
+    concreteClafers = filter isNotAbstract clafers
 
-tagType :: String -> String -> String -> String
-tagType name typename exp' = opening ++ rest
-  where
-  opening = concat ["<", name, " xsi:type=\"cl:", typename, "\""]
-  rest
-    | null exp' =" />"
-    | otherwise = concat [">", exp', "</", name, ">"]
+    claferWithUid u = fromMaybe (error $ "claferWithUid: \"" ++ u ++ "\" is not a clafer") $ findIClafer uidIClaferMap' u
 
-genPythonInteger :: Integer -> String
-genPythonInteger n = concat ["IntegerLiteral.IntegerLiteral(", show n, ")" ] -- might need to include IntegerLiteral
+    -- All abstract clafers u inherits
+    supersOf :: String -> [String]
+    supersOf u =
+        case superOf u of
+             Just su -> su : supersOf su
+             Nothing -> []
 
-isNull :: String -> String
-isNull [] = "\"\""
-isNull x = x
+    superOf u =
+        case _super $ claferWithUid u of
+            Just (PExp{_exp = IClaferId{_sident}})
+                | _sident == baseClafer -> Nothing
+                | isPrimitive _sident   -> Nothing
+                | otherwise             -> Just _sident
+            _ -> Nothing
 
-boolHelper:: String -> String
-boolHelper (x:xs) = toUpper x : xs
-boolHelper [] = []
+{-    refOf u =
+        case _reference $ claferWithUid u of
+            Just (IReference{_ref=PExp{_exp = IClaferId{_sident}}})
+                | _sident == "int"    -> Just "integer"
+                | isPrimitive _sident -> Just _sident
+                | otherwise           -> Nothing
+            _ -> Nothing
+-}
+    parentOf u = fst $ fromMaybe (error $ "parentOf: \"" ++ u ++ "\" is not a clafer") $ find ((== u) . _uid . snd) parentChildMap
 
-genPythonBoolean :: String -> Bool -> String
-genPythonBoolean label b = concat [label, "=", boolHelper $ toLowerS $ show b]
+    genCard :: Interval -> Maybe String
+    genCard (0, -1) = Nothing
+    genCard (low, -1) = return $ show low
+    genCard (low, high) = return $ show low ++ ", " ++ show high
 
-genPythonString :: String -> String
-genPythonString str = concat [ "StringLiteral.StringLiteral(", show str, ")"] -- might need to include StringLiteral
+    genImports = concat
+      [ "from jsir.IR import *\n"
 
-genPythonIntPair :: (Integer, Integer) -> String
-genPythonIntPair (x, y) = concat
-  [ "(", genPythonInteger x
-  , ","
-  , genPythonInteger y, ")"]
+      ]
 
--- | Generate an API for the IR in Python
-genPythonModule :: IModule -> Result
-genPythonModule imodule = concat
-  [ "from ast import Module\n"
-  , "from ast import GCard\n"
-  , "from ast import Supers\n"
-  , "from ast import Clafer\n"
-  , "from ast import Exp\n"
-  , "from ast import Declaration\n"
-  , "from ast import LocalDeclaration\n"
-  , "from ast import IRConstraint\n"
-  , "from ast import FunExp\n"
-  , "from ast import ClaferId\n"
-  , "from ast import DeclPExp\n"
-  , "from ast import Goal\n\n"
-  , "from ast import IntegerLiteral\n"
-  , "from ast import DoubleLiteral\n"
-  , "from ast import StringLiteral\n"
-  , "def getModule():\n"
-  , "\tstack = []\n"
-  , "\tmodule = Module.Module(\"\")\n"
-  , "\tstack.append(module)\n"
-  , concatMap genPythonElement $ _mDecls imodule
-  , "\treturn module"
-  ]
+    genScopes :: Result
+    genScopes =
+        (if null scopeMap then "" else "scope({" ++ intercalate ", " scopeMap ++ "});\n")
+        ++ "defaultScope(1);\n"
+        ++ "stringLength(" ++ show longestString ++ ");\n"
+        where
+            scopeMap = [uid' ++ ":" ++ show scope | (uid', scope) <- scopes, uid' /= "int"]
+    exprs :: [IExp]
+    exprs = universeOn biplate imodule
 
+    stringLength :: IExp -> Maybe Int
+    stringLength (IStr string) = Just $ length string
+    stringLength _ = Nothing
 
-genPythonClafer :: IClafer -> Result
-genPythonClafer x = case x of
-  IClafer pos' abstract' gcard' id' uid' puid' super' refrence' card' glcard' elements'  ->
-    concat [ "\t", genPythonPosition pos', "\n"
-           , "\t", genPythonAbstract abstract', "\n"
-           , "\t", maybe "" genPythonGCard gcard', "\n"
-           , "\t", genPythonId id', "\n"
-           , "\t", genPythonUid uid', "\n"
-           , "\t", genPythonParentUid puid', "\n"
-           , "\t", genPythonSuper super', "\n"
-           , "\t", genPythonReference refrence', "\n"
-           , "\t", maybe "" genPythonCard card', "\n"
-           , "\t", genPythonGlCard glcard', "\n"
-           , "\tcurrClafer = Clafer.Clafer(pos=pos, isAbstract=isAbstract, gcard=groupCard, ident=id, uid=uid, my_supers=my_supers, card=card, glCard=globalCard)\n"
-           , "\tstack[-1].addElement(currClafer)\n"
-           , "\tstack.append(currClafer)\n"
-           , concatMap genPythonElement elements'
-           , "\tstack.pop()\n"]
+    longestString :: Int
+    longestString = maximum $ 16 : mapMaybe stringLength exprs
 
-genPythonAbstract :: Bool -> String
-genPythonAbstract isAbstract' = concat [ genPythonBoolean "isAbstract" isAbstract']
+    genConcreteClafer :: IClafer -> Result
+    genConcreteClafer IClafer{_uid, _card = Just _card, _gcard = Just (IGCard _ _gcard)} =
+            _uid ++ " = " ++ constructor ++ "(\"" ++ _uid ++ "\")" ++ prop "withCard" (genCard _card) ++ prop "withGroupCard" (genCard _gcard) ++ prop "extending" (superOf _uid) ++ ";\n"
+        where
+            constructor =
+                case parentOf _uid of
+                     "root" -> "Clafer"
+                     puid   -> puid ++ ".addChild"
+    genConcreteClafer (IClafer _ _ Nothing _ _ _ _ _ _ _ _) = error "Choco.getConcreteClafer undefined"
+    genConcreteClafer (IClafer _ _ (Just (IGCard _ _)) _ _ _ _ _ Nothing _ _) = error "Choco.getConcreteClafer undefined"
 
-genPythonGCard :: IGCard -> String
-genPythonGCard (IGCard isKeyword' interval') = concat
-		[ "groupCard = GCard.GCard(", genPythonBoolean "isKeyword" isKeyword', ", "
-    	, "interval=" , genPythonInterval interval' , ")"]
+    prop name value =
+        case value of
+                Just value' -> "." ++ name ++ "(" ++ value' ++ ")"
+                Nothing     -> ""
 
-genPythonInterval :: (Integer, Integer) -> String
-genPythonInterval (nMin, nMax) = concat
-  [ "(", genPythonInteger nMin
-  , ",", genPythonInteger nMax
-  , ")"]
 
-genPythonId :: String -> String
-genPythonId ident' = concat[ "id=\"", ident', "\""]
+    genRefClafer :: IClafer -> Result
+    genRefClafer c@IClafer{_uid, _reference, _card} =
+        case (getReference c, _reference, _card) of
+             ([target], Just (IReference True _), Just (lb, ub))  -> if (lb > 1 || ub > 1 || lb == -1 || ub == -1)
+                then _uid ++ ".refToUnique(" ++ genTarget target ++ ");\n"
+                else _uid ++ ".refTo(" ++ genTarget target ++ ");\n"
+             ([target], Just (IReference _ _), _) -> _uid ++ ".refTo(" ++ genTarget target ++ ");\n"
+             _ -> ""
+        where
+            genTarget "integer" = "\"int\""
+            genTarget "int" = "\"int\""
+            genTarget target = target
 
-genPythonUid :: String -> String
-genPythonUid uid' = concat [ "uid=\"", uid', "\""]
+    genAbstractClafer :: IClafer -> Result
+    genAbstractClafer IClafer{_uid, _card = Just _} =
+        _uid ++ " = Abstract(\"" ++ _uid ++ "\")" ++ prop "extending" (superOf _uid) ++ ";\n"
+    genAbstractClafer IClafer{_uid, _card = Nothing} =
+        _uid ++ " = Abstract(\"" ++ _uid ++ "\")" ++ prop "extending" (superOf _uid) ++ ";\n"
 
-genPythonParentUid :: String -> String
-genPythonParentUid uid' = concat [ "parentUid=\"", uid', "\""]
 
-genPythonSuper :: Maybe PExp -> String
-genPythonSuper x = case x of
-  Nothing                      -> ""
-  Just pexp' -> concat
-    [ "my_Super = "
-    , genPythonPExp "Super" pexp'
-    ]
-
-genPythonReference :: Maybe IReference -> String
-genPythonReference x = case x of
-  Nothing                        -> ""
-  Just (IReference isSet' pexp') -> concat
-    [ "my_Reference = Reference.Reference("
-    , genPythonBoolean "isSet" isSet'
-    , ", "
-    , genPythonPExp "Ref" pexp'
-    , ")" ]
-
-genPythonCard :: (Integer, Integer) -> String
-genPythonCard interval' = concat [ "card=" , genPythonInterval interval']
-
-genPythonGlCard :: (Integer, Integer) -> String
-genPythonGlCard interval' = concat ["globalCard=", genPythonInterval interval']
-
-genPythonElement :: IElement -> String
-genPythonElement x = case x of
-  IEClafer clafer'  -> concat ["##### clafer #####\n" ,genPythonClafer clafer']
-  IEConstraint isHard' pexp'  -> concat
-                         [ "##### constraint #####\n", "\tconstraint = IRConstraint.IRConstraint(" , genPythonBoolean "isHard" isHard' , " ,"
-                         , " exp=", genPythonPExp "ParentExp" pexp' , ")\n"
-                         , "\tstack[-1].addElement(constraint)\n"]
-  IEGoal isMaximize' pexp' -> concat
-                         [ "##### goal #####\n" ,"\tgoal = Goal.Goal(" , genPythonBoolean "isMaximize" isMaximize'
-                         , ", exp=", genPythonPExp "ParentExp" pexp' , ")\n"
-                         , "\tstack[-1].addElement(goal)\n"]
-
+    genTopConstraint :: IElement -> Result
+    genTopConstraint (IEConstraint _ pexp) = "Constraint(" ++ genConstraintPExp pexp ++ ");\n"
+    genTopConstraint _ = ""
 
-{-genPythonAnyOp ft f xs = concatMap
-  (\(tname, texp) -> tagType tname (ft texp) $ f texp) xs -}
+    genConstraint :: IClafer -> Result
+    genConstraint IClafer{_uid, _elements} =
+        unlines [_uid ++ ".addConstraint(" ++ genConstraintPExp c ++ ");"
+            | c <- mapMaybe iconstraint _elements]
 
+    genGoal :: IElement -> Result
+    genGoal (IEGoal _ PExp{_exp = IFunExp{_op="max", _exps=[expr]}})  = "max(" ++ genConstraintPExp expr ++ ");\n"
+    genGoal (IEGoal _ PExp{_exp = IFunExp{_op="min", _exps=[expr]}})  = "min(" ++ genConstraintPExp expr ++ ");\n"
+    genGoal (IEGoal _ _) = error $ "Unknown objective"
+    genGoal _ = ""
 
-genPythonPExp :: String -> PExp -> String
-genPythonPExp tagName (PExp iType' pid' pos' iexp') = concat
-  [ "\n\t\tExp.Exp","(expType=\"", tagName, "\", ", maybe "exptype=\"\"" genPythonIType iType'
-  , ", parentId=\"", pid', "\""
-  , ", " , genPythonPosition pos'
-  , ", iExpType=\"" , genPythonIExpType iexp' , "\""
-  , ", iExp=[" , genPythonIExp iexp' ,"])"]
+    rewrite :: PExp -> PExp
+    -- Rearrange right joins to left joins.
+    rewrite p1@PExp{_iType = Just _, _exp = IFunExp "." [p2, p3@PExp{_exp = IFunExp "." _}]} =
+        p1{_exp = IFunExp "." [p3{_iType = _iType p4, _exp = IFunExp "." [p2, p4]}, p5]}
+        where
+            PExp{_exp = IFunExp "." [p4, p5]} = rewrite p3
+    rewrite p1@PExp{_exp = IFunExp{_op = "-", _exps = [PExp{_exp = IInt i}]}} =
+        -- This is so that the output looks cleaner, no other purpose since the Choco optimizer
+        -- in the backend will treat the pre-rewritten expression the same.
+        p1{_exp = IInt (-i)}
+    rewrite p = p
 
-genPythonPosition :: Span -> String
-genPythonPosition (Span (Pos s1 s2) (Pos e1 e2)) = concat
-  [ "pos=(", genPythonIntPair (s1, s2), ", ", genPythonIntPair (e1, e2), ")"]
+    genConstraintPExp :: PExp -> String
+    genConstraintPExp = genConstraintExp . _exp . rewrite
 
-genPythonIExpType :: IExp -> String
-genPythonIExpType x = case x of
-  IDeclPExp _ _ _ -> "IDeclarationParentExp"
-  IFunExp _ _ -> "IFunctionExp"
-  IInt _ -> "IIntExp"
-  IDouble _ -> "IDoubleExp"
-  IStr _ -> "IStringExp"
-  IClaferId _ _ _ _ -> "IClaferId"
+    genConstraintExp :: IExp -> String
+    genConstraintExp (IDeclPExp quant' [] body') =
+        mapQuant quant' ++ "(" ++ genConstraintPExp body' ++ ")"
+    genConstraintExp (IDeclPExp quant' decls' body') =
+        mapQuant quant' ++ "([" ++ intercalate ", " (map genDecl decls') ++ "], " ++ genConstraintPExp body' ++ ")"
+        where
+            genDecl (IDecl isDisj' locals body'') =
+                (if isDisj' then "disjDecl" else "decl") ++ "([" ++ intercalate ", " (map genLocal locals) ++ "], " ++ genConstraintPExp body'' ++ ")"
+            genLocal local =
+                local ++ " = local(\"" ++ local ++ "\")"
 
+    genConstraintExp (IFunExp "." [e1, PExp{_exp = IClaferId{_sident = "ref"}}]) =
+        "joinRef(" ++ genConstraintPExp e1 ++ ")"
+    genConstraintExp (IFunExp "." [e1, PExp{_exp = IClaferId{_sident = "parent"}}]) =
+        "joinParent(" ++ genConstraintPExp e1 ++ ")"
+    genConstraintExp (IFunExp "." [e1, PExp{_exp = IClaferId{_sident}}]) =
+        "join(" ++ genConstraintPExp e1 ++ ", " ++ _sident ++ ")"
+    genConstraintExp (IFunExp "." [_, _]) =
+        error $ "Did not rewrite all joins to left joins."
+    genConstraintExp (IFunExp "-" [arg]) =
+        "minus(" ++ genConstraintPExp arg ++ ")"
+    genConstraintExp (IFunExp "-" [arg1, arg2]) =
+        "sub(" ++ genConstraintPExp arg1 ++ ", " ++ genConstraintPExp arg2 ++ ")"
+    genConstraintExp (IFunExp "sum" args')
+        | [arg] <- args', PExp{_exp = IFunExp{_exps = [a, PExp{_exp = IClaferId{_sident = "ref"}}]}} <- rewrite arg =
+            "sum(" ++ genConstraintPExp a ++ ")"
+        | otherwise = error "Python: Unexpected sum argument."
+    genConstraintExp (IFunExp "+" args') =
+	(if _iType (head args') == Just TString then "concat" else "add") ++
+            "(" ++ intercalate ", " (map genConstraintPExp args') ++ ")"
+    genConstraintExp (IFunExp op' args') =
+        mapFunc op' ++ "(" ++ intercalate ", " (map genConstraintPExp args') ++ ")"
+    -- this is a keyword in Javascript so use "$this" instead
+    genConstraintExp IClaferId{_sident = "this"} = "$this()"
+    genConstraintExp IClaferId{_sident}
+        | _sident `elem` claferUids = "glob(" ++ _sident ++ ")"
+        | otherwise                = _sident
+    genConstraintExp (IInt val) = "constant(" ++ show val ++ ")"
+    genConstraintExp (IStr val) = "constant(" ++ show val ++ ")"
+    genConstraintExp (IDouble val) = "constant(" ++ show val ++ ")"
 
-declHelper :: [IDecl] -> String
-declHelper [] = "None, "
-declHelper x = concatMap genPythonDecl x
+    mapQuant INo = "none"
+    mapQuant ISome = "some"
+    mapQuant IAll = "all"
+    mapQuant IOne = "one"
+    mapQuant ILone = "lone"
 
-genPythonIExp :: IExp -> String
-genPythonIExp x = case x of
-  IDeclPExp quant' decls' pexp' -> concat
-    [ "DeclPExp.DeclPExp(" , "quantifier=\"", (genPythonQuantType quant'), "\", "
-    , "declaration=", declHelper decls'
-    , "bodyParentExp=" , genPythonPExp "BodyParentExp" pexp', ")"]
-  IFunExp op' exps' -> concat
-    [ "FunExp.FunExp(operation=\"" , (if op' == "-" && length exps' == 1 then "UNARY_MINUS" else op') , "\", elements="
-    , "[", concatMap (\y -> genPythonPExp "Argument" y ++",") (init exps') , genPythonPExp "Argument" (last exps') ,"])" ]
-{-    where
-    escape '\"'="&quot;"
-    escape '\''="&apos;"
-    escape '<' ="&lt;"
-    escape '>' ="&gt;"
-    escape '&' ="&amp;"
-    escape x    = [x] -}
-  IInt n -> genPythonInteger n
-  IDouble n ->  concat [ "DoubleLiteral.DoubleLiteral(", show n, ")"] --DoubleLiteral
-  IStr str -> genPythonString str
-  IClaferId modName' sident' isTop' bind' -> concat
-    [ "ClaferId.ClaferId(moduleName=\"", modName' , "\", "
-    , "my_id=\"", sident' , "\", "
-    , genPythonBoolean "isTop" isTop' , ", "
-    , "my_bind=\"", fromMaybe "" bind' , "\")"]
+    mapFunc "!" = "not"
+    mapFunc "#" = "card"
+    mapFunc "<=>" = "ifOnlyIf"
+    mapFunc "=>" = "implies"
+    mapFunc "||" = "or"
+    mapFunc "xor" = "xor"
+    mapFunc "&&" = "and"
+    mapFunc "<" = "lessThan"
+    mapFunc ">" = "greaterThan"
+    mapFunc "=" = "equal"
+    mapFunc "<=" = "lessThanEqual"
+    mapFunc ">=" = "greaterThanEqual"
+    mapFunc "!=" = "notEqual"
+    mapFunc "in" = "set_in"
+    mapFunc "not in" = "set_nin"
+    mapFunc "+" = "add"
+    mapFunc "*" = "mul"
+    mapFunc "/" = "div"
+    mapFunc "%" = "mod"
+    mapFunc "++" = "set_union"
+    mapFunc "--" = "set_diff"
+    mapFunc "**" = "set_inter"
+    mapFunc "ifthenelse" = "ifThenElse"
+    mapFunc op' = error $ "Python: Unknown op: " ++ op'
 
+{-    sidentOf u = ident $ claferWithUid u
+    scopeOf "integer" = undefined
+    scopeOf "int" = undefined
+    scopeOf i = fromMaybe 1 $ lookup i scopes -}
+    bitwidth = fromMaybe 4 $ lookup "int" scopes :: Integer
 
-genPythonDecl :: IDecl -> String
-genPythonDecl (IDecl disj locids pexp) = concat
-  [ "\n\t\tDeclaration.Declaration(" , genPythonBoolean "isDisjunct" disj, ", localDeclarations=["
-  , concatMap (\x -> "LocalDeclaration.LocalDeclaration(\"" ++ x ++ "\"), ") (init locids), "LocalDeclaration.LocalDeclaration(\"" , (last locids), "\")], "
-  , " body=", genPythonPExp "Body" pexp , "),"]
+-- isQuant PExp{_exp = IDeclPExp{}} = True
+-- isQuant _ = False
 
+isNotAbstract :: IClafer -> Bool
+isNotAbstract = not . _isAbstract
 
-genPythonQuantType :: IQuant -> String
-genPythonQuantType x = case x of
-  INo   -> "No"
-  ILone -> "Lone"
-  IOne  -> "One"
-  ISome -> "Some"
-  IAll  -> "All"
+iclafer :: IElement -> Maybe IClafer
+iclafer (IEClafer c) = Just c
+iclafer _ = Nothing
 
-genPythonITypeType :: IType -> String
-genPythonITypeType x = case x of
-  TBoolean -> "Boolean"
-  TString -> "String"
-  TInteger -> "Integer"
-  TReal -> "Real"
-  TClafer _-> "Set"
-  -- In the future, TRef might be needed in the Python IR.
-  -- For now, keep it simple.
-  --TRef t -> genPythonITypeType t
+iconstraint :: IElement -> Maybe PExp
+iconstraint (IEConstraint _ pexp) = Just pexp
+iconstraint _ = Nothing
 
-genPythonIType :: IType -> String
-genPythonIType x = concat [ "exptype=\"", (genPythonITypeType x), "\"" ]
+childClafers :: IClafer -> [(String, IClafer)]
+childClafers IClafer{_uid, _elements} =
+    childClafers' _uid =<< mapMaybe iclafer _elements
+    where
+    childClafers' parent' c@IClafer{_uid, _elements} = (parent', c) : (childClafers' _uid  =<< mapMaybe iclafer _elements)
diff --git a/src/Language/Clafer/Generator/Schema.hs b/src/Language/Clafer/Generator/Schema.hs
--- a/src/Language/Clafer/Generator/Schema.hs
+++ b/src/Language/Clafer/Generator/Schema.hs
@@ -27,15 +27,12 @@
   , "  *   http://clafer.org                                                       *\n"
   , "  *                                                                           *\n"
   , "  *   File description: XML schema of Clafer intermediate representation (IR) *\n"
-  , "  *   Depends on: Haskell IR data types defined for clafer                    *\n"
+  , "  *   Depends on: Haskell IR data types defined for clafer (Intclafer.hs)     *\n"
   , "  *   Author: Leonardo Passos <lpassos@gsd.uwaterloo.ca>                      *\n"
   , "  *   Contributors: Jimmy Liang <jliang@gsd.uwaterloo.ca>                     *\n"
+  , "  *                 Michal Antkiewicz <mantkiew@gsd.uwaterloo.ca>             *\n"
   , "  *   Date: October 19th, 2011                                                *\n"
-  , "  *   Last update: April 16th, 2012                                           *\n"
-  , "  *                                                                           *\n"
-  , "  *   Generate scala classes with:                                            *\n"
-  , "  *   scalaxb -p gsd.clafer.ir ClaferIR.xsd                                   *\n"
-  , "  *           - -protocol-file ClaferIR_XmlProtocol.scala                     *\n"
+  , "  *   Last update: February 4th, 2015                                         *\n"
   , "  * ......................................................................... *\n"
   , "  */\n"
   , "-->\n"
@@ -114,8 +111,9 @@
   , "    , _gcard :: Maybe IGCard\n"
   , "    , _ident :: CName\n"
   , "    , _uid :: UID\n"
-  , " , _parentUID :: UID\n"
-  , "    , _super:: ISuper\n"
+  , "    , _parentUID :: UID\n"
+  , "    , _super :: Maybe PExp\n"
+  , "    , _reference :: Maybe IReference\n"
   , "    , _card :: Maybe Interval\n"
   , "    , _glCard :: Interval\n"
   , "    , _elements :: [IElement]\n"
@@ -150,7 +148,8 @@
   , "                <xs:element name=\"Id\"         type=\"xs:string\"/>\n"
   , "                <xs:element name=\"UniqueId\"   type=\"xs:string\"/>\n"
   , "                <xs:element name=\"ParentUniqueId\" type=\"xs:string\"/>\n"
-  , "                <xs:element name=\"Supers\"     type=\"cl:ISuper\"/>\n"
+  , "                <xs:element name=\"Super\"      type=\"cl:IParentExp\" minOccurs=\"0\" maxOccurs=\"1\"/>\n"
+  , "                <xs:element name=\"Reference\"  type=\"cl:IReference\" minOccurs=\"0\" maxOccurs=\"1\"/>\n"
   , "                <xs:element name=\"Card\"       type=\"cl:IInterval\" minOccurs=\"0\" maxOccurs=\"1\"/>\n"
   , "                <xs:element name=\"GlobalCard\" type=\"cl:IInterval\"/>\n"
   , "                <xs:element ref=\"Declaration\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n"
@@ -169,7 +168,6 @@
   , "    { _isHard :: Bool\n"
   , "    , _cpexp :: PExp\n"
   , "    }\n"
-  , "  -- | Goal (optimization objective)\n"
   , "  | IEGoal\n"
   , "    { _isMaximize :: Bool\n"
   , "    , _cpexp :: PExp\n"
@@ -199,8 +197,8 @@
   , "    <xs:complexContent>\n"
   , "      <xs:extension base=\"cl:IElement\">\n"
   , "          <xs:sequence>\n"
-  , "              <xs:element name=\"IsMaximize\"    type=\"xs:boolean\"/>\n"
-  , "              <xs:element name=\"ParentExp\" type=\"cl:IParentExp\"/>\n"
+  , "              <xs:element name=\"IsMaximize\" type=\"xs:boolean\"/>\n"
+  , "              <xs:element name=\"ParentExp\"  type=\"cl:IParentExp\"/>\n"
   , "          </xs:sequence>\n"
   , "      </xs:extension>\n"
   , "\n"
@@ -209,16 +207,16 @@
   , "\n"
   , "  <!-- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .-->\n"
   , "  <!--\n"
-  , "data ISuper\n"
-  , "  = ISuper\n"
-  , "    { _isOverlapping :: Bool\n"
-  , "    , _supers :: [PExp]\n"
+  , "data IReference\n"
+  , "  = IReference\n"
+  , "    { _isSet :: Bool\n"
+  , "    , _ref :: PExp\n"
   , "    }\n"
   , "  -->\n"
-  , "  <xs:complexType name=\"ISuper\">\n"
+  , "  <xs:complexType name=\"IReference\">\n"
   , "    <xs:sequence>\n"
-  , "        <xs:element name=\"IsOverlapping\" type=\"xs:boolean\"/>\n"
-  , "        <xs:element name=\"Super\"         type=\"cl:IParentExp\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n"
+  , "        <xs:element name=\"IsSet\" type=\"xs:boolean\"/>\n"
+  , "        <xs:element name=\"Ref\"   type=\"cl:IParentExp\"/>\n"
   , "    </xs:sequence>\n"
   , "  </xs:complexType>\n"
   , "\n"
@@ -391,7 +389,7 @@
   , "                  <xs:element name=\"ModuleName\" type=\"xs:string\" minOccurs=\"0\" maxOccurs=\"1\"/>\n"
   , "                  <xs:element name=\"Id\"         type=\"xs:string\" />\n"
   , "                  <xs:element name=\"IsTop\"      type=\"xs:boolean\"/>\n"
-  , "                  <xs:element name=\"Bind\"       type=\"xs:string\" />\n"
+  , "                  <xs:element name=\"Bind\"    type=\"xs:string\" />\n"
   , "              </xs:sequence>\n"
   , "          </xs:extension>\n"
   , "      </xs:complexContent>\n"
@@ -401,9 +399,9 @@
   , "  <!--\n"
   , "data IDecl\n"
   , "  = IDecl\n"
-  , "    { _isDisj :: Bool    -- ^ is disjunct\n"
-  , "    , _decls :: [CName]  -- ^ a list of local names\n"
-  , "    , _body :: PExp      -- ^ set to which local names refer to\n"
+  , "    { _isDisj :: Bool\n"
+  , "    , _decls :: [CName]\n"
+  , "    , _body :: PExp\n"
   , "    }\n"
   , "    -->\n"
   , "\n"
diff --git a/src/Language/Clafer/Generator/Xml.hs b/src/Language/Clafer/Generator/Xml.hs
--- a/src/Language/Clafer/Generator/Xml.hs
+++ b/src/Language/Clafer/Generator/Xml.hs
@@ -27,7 +27,7 @@
 import Data.Maybe (fromMaybe)
 
 import Language.Clafer.Common
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Intclafer
 
 tag :: String -> String -> String
diff --git a/src/Language/Clafer/Intermediate/Analysis.hs b/src/Language/Clafer/Intermediate/Analysis.hs
deleted file mode 100644
--- a/src/Language/Clafer/Intermediate/Analysis.hs
+++ /dev/null
@@ -1,445 +0,0 @@
-{-# LANGUAGE NamedFieldPuns, FlexibleContexts, FlexibleInstances, UndecidableInstances, GeneralizedNewtypeDeriving, StandaloneDeriving #-}
-
-{-
- Copyright (C) 2012 Jimmy Liang, Kacper Bak <http://gsd.uwaterloo.ca>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
--}
-
-{-
- - Common methods for analyzing Clafer model.
- -}
-module Language.Clafer.Intermediate.Analysis where
-
-import Language.Clafer.Front.Absclafer hiding (Path)
-import qualified Language.Clafer.Intermediate.Intclafer as I
-import Language.Clafer.Intermediate.Desugarer
-import Language.Clafer.Front.Printclafer
-import Language.Clafer.Common
-
-import Control.Applicative
-import Control.Monad.LPMonad.Supply
-import Control.Monad.Error
-import Control.Monad.Identity
-import Control.Monad.List
-import Control.Monad.Maybe
-import Control.Monad.Reader
-import Control.Monad.State
-import Control.Monad.Writer
-import Data.Either
-import Data.List
-import Data.Maybe
-
-
-
-newtype AnalysisT m a = AnalysisT (ReaderT Info m a)
-  deriving (Monad, Functor, MonadReader Info, MonadState s, MonadTrans, MonadPlus, MonadError e, Applicative, Alternative)
-
-type Analysis = AnalysisT Identity
-
-class (Monad m, Functor m) => MonadAnalysis m where
-  clafers :: m [SClafer]
-  withClafers :: [SClafer] -> m a -> m a
-
-withExtraClafers :: MonadAnalysis m => [SClafer] -> m a -> m a
-withExtraClafers cs a =
-    do
-        c <- clafers
-        withClafers (cs ++ c) a
-
-instance (Monad m, Functor m) => MonadAnalysis (AnalysisT m) where
-  clafers = AnalysisT $ asks sclafers
-  withClafers cs = local (const $ Info cs)
-
-instance (Error e, MonadAnalysis m) => MonadAnalysis (ErrorT e m) where
-  clafers = lift clafers
-  withClafers = mapErrorT . withClafers
-
-instance MonadAnalysis m => MonadAnalysis (ListT m) where
-  clafers = lift clafers
-  withClafers = mapListT . withClafers
-
-instance MonadAnalysis m => MonadAnalysis (MaybeT m) where
-  clafers = lift clafers
-  withClafers = mapMaybeT . withClafers
-
-instance MonadAnalysis m => MonadAnalysis (ReaderT r m) where
-  clafers = lift clafers
-  withClafers = mapReaderT . withClafers
-
-instance (Monoid w, MonadAnalysis m) => MonadAnalysis (WriterT w m) where
-  clafers = lift clafers
-  withClafers = mapWriterT . withClafers
-
-instance MonadAnalysis m => MonadAnalysis (VSupplyT m) where
-  clafers = lift clafers
-  withClafers = mapVSupplyT . withClafers
-
-isConcrete :: SClafer -> Bool
-isConcrete = not . isAbstract
-
-isBase :: SClafer -> Bool
-isBase = (`elem` (baseClafer : primitiveTypes)) . uid
-
-isDerived :: SClafer -> Bool
-isDerived = not . isBase
-
-
--- | Easier to work with. IClafers have links from parents to children. SClafers have links from children to parent.
-data SClafer = SClafer {uid::String, origUid::String, isAbstract::Bool, low::Integer, high::Integer, groupLow::Integer, groupHigh::Integer, parent::Maybe String, super::Maybe String, reference::Maybe String, constraints::[I.PExp]} deriving Show
-
-data Info = Info{sclafers :: [SClafer]} deriving Show
-
-runAnalysis :: Analysis a -> Info -> a
-runAnalysis r info = runIdentity $ runAnalysisT r info
-
-runAnalysisT :: AnalysisT m a -> Info -> m a
-runAnalysisT (AnalysisT r) info = runReaderT r info
-
-claferWithUid :: MonadAnalysis m => String -> m SClafer
-claferWithUid u =
-  do
-    c <- clafers
-    case find ((==) u . uid) c of
-      Just c' -> return c'
-      Nothing -> error $ "claferWithUid: Unknown uid " ++ u
-
-parentUid :: Monad m => SClafer -> m String
-parentUid clafer =
-  case parent clafer of
-    Just p  -> return p
-    Nothing -> fail $ "No parent uid for " ++ show clafer
-
-parentOf :: (Uidable c, MonadAnalysis m) => c -> m c
-parentOf clafer = fromUid =<< parentUid =<< toClafer clafer
-
-parentsOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-parentsOf clafer =
-  do
-    r <- runMaybeT $ parentOf clafer
-    case r of
-         Just r' -> (r' :) <$> parentsOf r'
-         Nothing -> return []
-
-ancestorsOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-ancestorsOf clafer = (clafer :) <$> parentsOf clafer
-
-directChildrenOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-directChildrenOf c =
-  do
-    cs <- (anything |^ c) `select` fst
-    mapM fromClafer cs
-
-directDescendantsOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-directDescendantsOf c =
-  do
-    cs <- (anything |^ c) `select` fst
-    css <- mapM directDescendantsOf cs
-    mapM fromClafer $ cs ++ concat css
-
-topNonRootAncestor :: (Uidable c, MonadAnalysis m) => c -> m c
-topNonRootAncestor clafer =
-  do
-    uid' <- toUid clafer
-    when (uid' == rootIdent) $ error "Root does not have a non root ancestor."
-    (head . tail . reverse) <$> ancestorsOf clafer
-
-refUid :: Monad m => SClafer -> m String
-refUid clafer =
-  case reference clafer of
-    Just u  -> return u
-    _       -> fail $ "No ref uid for " ++ show clafer
-
-refOf :: (Uidable c, MonadAnalysis m) => c -> m c
-refOf clafer = fromUid =<< refUid =<< toClafer clafer
-
-refsOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-refsOf clafer =
-  do
-    r <- runMaybeT $ refOf clafer
-    case r of
-         Just r' -> (r' :) <$> refsOf r'
-         Nothing -> return []
-
-colonUid :: (Uidable c, MonadAnalysis m) => c -> m String
-colonUid c =
-  do
-    clafer <- toClafer c
-    case super clafer of
-      Just u -> return u
-      _      -> fail $ "No colon uid for " ++ show clafer
-
-colonOf :: (Uidable c, MonadAnalysis m) => c -> m c
-colonOf clafer = fromUid =<< colonUid =<< toClafer clafer
-
-colonsOf :: (Uidable c, MonadAnalysis m) => c -> m [c]
-colonsOf clafer =
-  do
-    r <- runMaybeT $ colonOf clafer
-    case r of
-         Just r' -> (r' :) <$> colonsOf r'
-         Nothing -> return []
-
--- "subclafers"
-colonsTo :: (Uidable c, MonadAnalysis m) => c -> m [c]
-colonsTo clafer =
-    runListT $ do
-        (sub, _) <- foreach $ anything |: clafer
-        fromClafer =<< (return sub `mplus` foreach ( colonsTo sub))
-
-
-
-hierarchy :: (Uidable c, MonadAnalysis m) => c -> m [c]
-hierarchy t = (t :) <$> colonsOf t
-
-{-
- - C is a direct child of B.
- -
- -  B
- -    C
- -}
-isDirectChild :: (Uidable c, MonadAnalysis m) => c -> c -> m Bool
-isDirectChild c p = (not . null) <$> (c |^ p)
-
-{-
- - C is an direct child of B.
- -
- -  abstract A
- -    C
- -  B : A
- -}
-isIndirectChild :: (Uidable c, MonadAnalysis m) => c -> c -> m Bool
-isIndirectChild c p =
-  fromMaybeT False $ do
-    child <- toClafer c
-    parent <- toClafer p
-    s <- colonOf parent
-    when (uid s == "clafer") mzero
-    isChild child s
-
-isChild :: (Uidable c, MonadAnalysis m) => c -> c -> m Bool
-isChild child parent =
-  liftM2 (||) (isDirectChild child parent) (isIndirectChild child parent)
-
-class Matchable c => Uidable c where
-  toClafer :: MonadAnalysis m => c -> m SClafer
-  fromClafer :: MonadAnalysis m => SClafer -> m c
-  toUid :: MonadAnalysis m => c -> m String
-  fromUid :: MonadAnalysis m => String -> m c
-
-instance Uidable SClafer where
-  toClafer = return
-  fromClafer = return
-  toUid = return . uid
-  fromUid = claferWithUid
-
-instance Uidable String where
-  toClafer = claferWithUid
-  fromClafer = return . uid
-  toUid = return
-  fromUid = return
-
-data Anything = Anything
-
-class Matchable u where
-  matches :: u -> SClafer -> Bool
-
-instance Matchable String where
-  matches s c = s == uid c
-
-instance Matchable Anything where
-  matches _ _ = True
-
-instance Matchable SClafer where
-  matches c1 c2 = uid c1 == uid c2
-
-anything :: Anything
-anything = Anything
-
-
--- a is a child of b
-(|^) :: (MonadAnalysis m, Matchable a, Matchable b) => a -> b -> m [(SClafer, SClafer)]
-lower |^ upper = runListT $ do
-    clafer <- foreach clafers
-    guard $ matches lower clafer
-    parent <- parentOf clafer
-    guard $ matches upper parent
-    return (clafer , parent)
-
--- a -> b
-(|->) :: (MonadAnalysis m, Matchable a, Matchable b) => a -> b -> m [(SClafer, SClafer)]
-lower |-> upper = runListT $ do
-    clafer <- foreach clafers
-    guard $ matches lower clafer
-    super  <- refOf clafer
-    guard $ matches upper super
-    return (clafer, super)
-
--- a : b
-(|:) :: (MonadAnalysis m, Matchable a, Matchable b) => a -> b -> m [(SClafer, SClafer)]
-lower |: upper = runListT $ do
-    clafer <- foreach clafers
-    guard $ matches lower clafer
-    super  <- colonOf clafer
-    guard $ matches upper super
-    return (clafer, super)
-
--- constraints under
-constraintsUnder :: (MonadAnalysis m, Matchable a) => a -> m [(SClafer, I.PExp)]
-constraintsUnder under =
-  do
-    clafers' <- filter (matches under) <$> clafers
-    return [(clafer, constraint) | clafer <- clafers', constraint <- constraints clafer]
-
--- Converts IClafer to SClafer
-convertClafer :: I.IClafer -> [SClafer]
-convertClafer =
-  convertClafer' Nothing
-  where
-  convertElement' parent (I.IEClafer clafer) = Just $ Left $ convertClafer' parent clafer
-  convertElement' _ (I.IEConstraint _ pexp)   = Just $ Right $ pexp
-  convertElement' _ _ = Nothing
-
-  convertClafer' parent clafer =
-    sclafer : concat children
-    where
-    sclafer
-      | maybe 1 groupLow parent == 0 && maybe 1 groupHigh parent /= -1 =
-          SClafer (I._uid clafer) (I._uid clafer) (I._isAbstract clafer) 1   high gLow gHigh (uid <$> parent) super reference constraints
-      | otherwise =
-          SClafer (I._uid clafer) (I._uid clafer) (I._isAbstract clafer) low high gLow gHigh (uid <$> parent) super reference constraints
-    (children, constraints) = partitionEithers $ mapMaybe (convertElement' $ Just $ sclafer) (I._elements clafer)
-
-    Just (low, high) = I._card clafer
-    (gLow, gHigh) =
-      case I._gcard clafer of
-        Nothing -> (0, -1)
-        -- TODO: Bug w/ keywords?
-        Just (I.IGCard True _) -> (0, 1)
-        Just (I.IGCard _ i)    -> i
-    super =
-      case I._super clafer of
-        Just (I.PExp{I._exp = I.IClaferId{I._sident = superUid}})  -> Just superUid
-        _ -> Nothing
-    reference =
-      case I._reference clafer of
-        Just (I.IReference _ I.PExp{I._exp = I.IClaferId{I._sident = refUid'}})  -> Just refUid'
-        _ -> Nothing
-
-gatherInfo :: I.IModule -> Info
-gatherInfo imodule =
-  Info $ sClafer : sInteger : sInt : sReal : sString : sBoolean : convertClafer root
-  where
-  sClafer = SClafer baseClafer baseClafer False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-  sInteger = SClafer integerType integerType False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-  sInt     = SClafer "int" "int" False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-  sReal    = SClafer realType realType False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-  sString  = SClafer stringType stringType False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-  sBoolean = SClafer booleanType booleanType False 0 (-1) 0 (-1) Nothing Nothing Nothing []
-
-  root = I.IClafer noSpan False Nothing rootIdent rootIdent "" Nothing Nothing (Just (1, 1)) (0, 0) $ I._mDecls imodule
-
-
-
-
-
-{-
- -
- - Utility functions
- -
- -}
-liftMaybe :: Monad m => Maybe a -> MaybeT m a
-liftMaybe = MaybeT . return
-
-liftList :: Monad m => [a] -> ListT m a
-liftList = ListT . return
-
-runListT_ :: Monad m => ListT m a -> m ()
-runListT_ l = runListT l >> return ()
-
-foreach :: m[a] -> ListT m a
-foreach = ListT
-
-foreachM :: Monad m => [a] -> ListT m a
-foreachM = ListT . return
-
-subClafers :: (a, b) -> a
-subClafers = fst
-
-superClafers :: (a, b) -> b
-superClafers = snd
-
-findAll :: Monad m => m a -> ListT m a
-findAll = lift
-
-select :: Monad m => m [a] -> (a -> b) -> m [b]
-select from f = from >>= return . map f
-
-suchThat :: Monad m => m [a] -> (a -> Bool) -> m [a]
-suchThat = flip $ liftM . filter
-
-concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
-concatMapM f l = concat `liftM` mapM f l
-
-whenM :: Monad m => m Bool -> m () -> m ()
-whenM a b = a >>= (`when` b)
-
-unlessM :: Monad m => m Bool -> m() -> m()
-unlessM a b = a >>= (`unless` b)
-
-fromMaybeT :: Monad m => a -> MaybeT m a -> m a
-fromMaybeT def m = fromMaybe def `liftM` runMaybeT m
-
-mapMaybeT :: (m1 (Maybe a1) -> m (Maybe a)) -> MaybeT m1 a1 -> MaybeT m a
-mapMaybeT f = MaybeT . f . runMaybeT
-
-mapVSupplyT :: (Monad m, Monad m1) => (m1 a1 -> m a) -> VSupplyT m1 a1 -> VSupplyT m a
-mapVSupplyT f = lift . f . runVSupplyT
-
-mapLeft :: (t -> a) -> Either t b -> Either a b
-mapLeft f (Left l)  = Left $ f l
-mapLeft _ (Right r) = Right r
-
-mapRight :: (t -> b) -> Either a t -> Either a b
-mapRight _ (Left l)  = Left l
-mapRight f (Right r) = Right $ f r
-
-(<:>) :: Monad m => m a -> m [a] -> m [a]
-(<:>) = liftM2 (:)
-
-testing :: Eq b => (a -> b) -> a -> a -> Bool
-testing f a b = f a == f b
-
-comparing :: Ord b => (a -> b) -> a -> a -> Ordering
-comparing f a b = f a `compare` f b
-
-syntaxOf :: I.PExp -> String
-syntaxOf = printTree . sugarExp
-
--- http://stackoverflow.com/questions/1714006/haskell-grouping-problem
-combine :: Ord a => [(a, b)] -> [(a, [b])]
-combine =
-    map mergeGroup . groupBy (testing fst) . sortBy (comparing fst)
-    where
-    mergeGroup ((a, b):xs) = (a, b : map snd xs)
-    mergeGroup [] = error "Function mergeGroup from Analysis expected a non empty list, but was given an empty one"
-
--- Returns true iff the left and right expressions are syntactically identical
-sameAs :: I.PExp -> I.PExp -> Bool
-sameAs e1 e2 = syntaxOf e1 == syntaxOf e2 -- Not very efficient but hopefully correct
diff --git a/src/Language/Clafer/Intermediate/Desugarer.hs b/src/Language/Clafer/Intermediate/Desugarer.hs
--- a/src/Language/Clafer/Intermediate/Desugarer.hs
+++ b/src/Language/Clafer/Intermediate/Desugarer.hs
@@ -20,14 +20,14 @@
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
 -}
-{- | Transforms an Abstract Syntax Tree (AST) from "Language.Clafer.Front.Absclafer"
+{- | Transforms an Abstract Syntax Tree (AST) from "Language.Clafer.Front.AbsClafer"
 into Intermediate representation (IR) from "Language.Clafer.Intermediate.Intclafer" of a Clafer model.
 -}
 module Language.Clafer.Intermediate.Desugarer where
 
 import Language.Clafer.Common
 import Data.Maybe (fromMaybe)
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Intclafer
 
 -- | Transform the AST into the intermediate representation (IR)
@@ -90,10 +90,10 @@
       else desugarClafer' claf
     _ -> desugarClafer' claf
     where
-      desugarClafer' claf@(Clafer s abstract gcrd' id' super' reference' crd' init' elements') =
-        (IEClafer $ IClafer s (desugarAbstract abstract) (desugarGCard gcrd') (transIdent id')
-            "" "" (desugarSuper super') (desugarReference reference') (desugarCard crd') (0, -1)
-            (desugarElements elements')) : (desugarInit id' init')
+      desugarClafer' (Clafer s'' abstract'' gcrd'' id'' super'' reference'' crd'' init'' elements'') =
+        (IEClafer $ IClafer s'' (desugarAbstract abstract'') (desugarGCard gcrd'') (transIdent id'')
+            "" "" (desugarSuper super'') (desugarReference reference'') (desugarCard crd'') (0, -1)
+            (desugarElements elements'')) : (desugarInit id'' init'')
 
 getPExpClaferIdent :: SetExp -> String
 getPExpClaferIdent (ClaferId _ (Path _ [ (ModIdIdent _ (PosIdent (_, ident'))) ] )) = ident'
@@ -152,10 +152,8 @@
 
 sugarReference :: Maybe IReference -> Reference
 sugarReference Nothing = ReferenceEmpty noSpan
-sugarReference (Just (IReference True (pexp'@(PExp _ _ _ (IClaferId _ _ _ _))))) = ReferenceSet noSpan (sugarSetExp pexp')
-sugarReference (Just (IReference False (pexp'@(PExp _ _ _ (IClaferId _ _ _ _))))) = ReferenceBag noSpan (sugarSetExp pexp')
-sugarReference (Just (IReference _ pexp')) = error $ "Function sugarReference from Desugarer expects a IReference (PExp (IClaferId)) but instead was given: " ++ show pexp' -- Should never happen
-
+sugarReference (Just (IReference True  pexp')) = ReferenceSet noSpan (sugarSetExp pexp')
+sugarReference (Just (IReference False pexp')) = ReferenceBag noSpan (sugarSetExp pexp')
 
 sugarInitHow :: Bool -> InitHow
 sugarInitHow True  = InitConstant noSpan
@@ -303,8 +301,10 @@
   ESub _ exp0 exp'  -> dop iSub [exp0, exp']
   EMul _ exp0 exp'  -> dop iMul [exp0, exp']
   EDiv _ exp0 exp'  -> dop iDiv [exp0, exp']
+  ERem _ exp0 exp'  -> dop iRem [exp0, exp']
   ECSetExp _ exp'   -> dop iCSet [exp']
   ESumSetExp _ exp' -> dop iSumSet [exp']
+  EProdSetExp _ exp' -> dop iProdSet [exp']
   EMinExp _ exp'    -> dop iMin [exp']
   EGMax _ exp' -> dop iGMax [exp']
   EGMin _ exp' -> dop iGMin [exp']
@@ -381,7 +381,8 @@
     | op'' == iGMax          = EGMax noSpan
     | op'' == iGMin          = EGMin noSpan
     | op'' == iSumSet        = ESumSetExp noSpan
-    | otherwise            = error $ show op'' ++ "is not an op"
+    | op'' == iProdSet       = EProdSetExp noSpan
+    | otherwise              = error $ show op'' ++ "is not an op"
   sugarOp op''
     | op'' == iIff           = EIff noSpan
     | op'' == iImpl          = EImplies noSpan
@@ -400,6 +401,7 @@
     | op'' == iSub           = ESub noSpan
     | op'' == iMul           = EMul noSpan
     | op'' == iDiv           = EDiv noSpan
+    | op'' == iRem           = ERem noSpan
     | otherwise            = error $ show op'' ++ "is not an op"
   sugarTerOp op''
     | op'' == iIfThenElse    = EImpliesElse noSpan
diff --git a/src/Language/Clafer/Intermediate/GLPKScopeAnalyzer.hs b/src/Language/Clafer/Intermediate/GLPKScopeAnalyzer.hs
deleted file mode 100644
--- a/src/Language/Clafer/Intermediate/GLPKScopeAnalyzer.hs
+++ /dev/null
@@ -1,1032 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, UndecidableInstances, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, NamedFieldPuns, TupleSections #-}
-
-{-
- Copyright (C) 2012-2013 Jimmy Liang, Kacper Bak <http://gsd.uwaterloo.ca>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
--}
-module Language.Clafer.Intermediate.GLPKScopeAnalyzer (glpkScopeAnalysis) where
-
-import Language.Clafer.Front.Absclafer hiding (Path)
-import qualified Language.Clafer.Intermediate.Intclafer as I
-import Language.Clafer.Intermediate.Analysis
-import Language.Clafer.Intermediate.ResolverType
-import Language.Clafer.Common
-
-import Control.Applicative (Applicative(..), (<$>))
-import Control.Monad
-import Control.Monad.List
-import Control.Monad.LPMonad
-import Control.Monad.Maybe
-import Control.Monad.Reader
-import Control.Monad.State
-import Data.Either
-import Data.LinearProgram hiding (constraints)
-import Data.List
-import Data.Map ()
-import qualified Data.Map as Map
-import Data.Maybe
-import System.IO.Unsafe
-import Text.Parsec.Combinator
-import Text.Parsec.Error
-import Text.Parsec.Pos
-import Text.Parsec.Prim
-import Text.Parsec.String ()
-
-
-{------------------------------------------------------------
- ---------- Linear programming ------------------------------
- ------------------------------------------------------------}
-
--- | Compute scopes for clafers by solving a system of linear equations
-glpkScopeAnalysis :: I.IModule -> [(String, Integer)]
-glpkScopeAnalysis imodule =
-  intScope ++ scopes
-  where
-  intScope = if bitwidth > 4 then return ("int", bitwidth) else fail "Bitwidth less than default."
-  bitwidth = bitwidthAnalysis (constants ++ map snd scopes)
-
-  scopes =
-      removeZeroes $ removeRoot $ removeAux $
-      -- unsafePerformIO should be safe (?)
-      -- We aren't modifying any global state.
-      -- If we don't use unsafePerformIO, then we have to be inside the IO monad and
-      -- makes things really ugly. Might as well contain the ugliness in here.
-      case unsafePerformIO solution of
-        (Success, Just (_, s)) -> Map.toList $ Map.map round s
-        _ -> [] -- No solution
-
-  ((_, constants), analysis) = runScopeAnalysis run $ gatherInfo imodule
-
-  run =
-    do
-      setConstraints
-      abstracts' <- clafers `suchThat` isAbstract
-      constants' <- constantsAnalysis
-      return (abstracts', constants')
-
-  solution = {-trace (show $ unsafePerformIO $ writeLP "TESTTT" analysis) $-} glpSolveVars mipDefaults{msgLev = MsgOff} $ analysis
-  -- Any scope that is 0 will take the global scope of 1 instead.
-  removeZeroes = filter ((/= 0) . snd)
-  -- The root is implied and not and not part of the actual solution.
-  removeRoot = filter ((/= rootIdent) . fst)
-  -- Auxilary variables are only part of the computation, not the solution.
-  removeAux = filter (not . (uniqNameSpace `isPrefixOf`) . fst)
-  -- The scope for abstract clafers are removed. Alloy doesn't need it. Makes
-  -- it easier use since user can increase the scope of subclafers without
-  -- needing to increase the scope of the abstract Clafer.
-  --removeAbstracts = filter (not . (`elem` map uid abstracts) . fst)
-
-
-bitwidthAnalysis :: [Integer] -> Integer
-bitwidthAnalysis constants =
-  toInteger $ 1 + fromJust (findIndex (\x -> all (`within` x) constants) bitRange)
-  where
-  within a (minB, maxB) = a >= minB && a <= maxB
-  bitRange = [(-2^i, 2^i-1) | i <- ([0..]::[Integer])]
-
-
--- Returns all constant literals
-constantsAnalysis :: ScopeAnalysis [Integer]
-constantsAnalysis =
-  do
-    cons <- constraintsUnder anything `select` snd
-    return $ mapMaybe integerConstant [I._exp sub | con <- cons, sub <- subexpressions con]
-  where
-  integerConstant (I.IInt i) = Just i
-  integerConstant _ = Nothing
-
-
--- (-1) for infinity
-data Between =
-    Between Integer Integer
-    deriving Show
-
---atLeastOne :: Between -> Bool
---atLeastOne (Between i _) = i >= 1
-{-
-overlap :: Between -> Between -> Maybe Between
-overlap (Between l1 h1) (Between l2 h2)
-    | l1 > h2 && h2 /= -1 = Nothing
-    | l2 > h1 && h1 /= -1 = Nothing
-    | otherwise = Just $ Between (maxx l1 l2) (minn h1 h2)
-    where
-    minn (-1) b = b
-    minn a (-1) = a
-    minn a b = min a b
-
-    maxx (-1) _ = -1
-    maxx _ (-1) = -1
-    maxx a b = max a b
-
-overlapM :: Maybe Between -> Maybe Between -> Maybe Between
-overlapM a b =
-    do
-        a' <- a
-        b' <- b
-        overlap a' b'
--}
-
--- Multiplies two positive integers where -1=infinity
-mult :: Integer -> Integer -> Integer
-mult (-1) _ = -1
-mult _ (-1) = -1
-mult a b = a * b
-
-
-
-simpleAnalysis :: ScopeAnalysis [(String, Between)]
-simpleAnalysis =
-    do
-        root <- claferWithUid rootIdent
-        analysis <- simpleAnalysis' root (Between 1 1)
-        --moreAnalysis <- simpleConstraintAnalysis analysis
-        return analysis
-    where
-    simpleAnalysis' cur cb@(Between l h) =
-        runListT $ return (uid cur, cb) `mplus` do
-            child <- foreach $ (anything |^ cur) `select` fst
-            let b
-                 | groupLow cur == 0 && groupHigh cur == -1 = Between (low child * l) (high child `mult` h)
-                 | otherwise                                = Between 0 (-1)
-            foreach (simpleAnalysis' child b)
-{-
-    mergeAnalysis analysis =
-        [(n, fromJust x) | (n, b) <- combine analysis, let x = foldr1 overlapM $ map Just b, isJust x]
-
-    simpleConstraintAnalysis :: [(String, Between)] -> ScopeAnalysis [(String, Between)]
-    simpleConstraintAnalysis analysis = mergeAnalysis <$> simpleConstraintAnalysis' analysis
-
-    simpleConstraintAnalysis' analysis =
-        runListT $ do
-            (curThis, cons) <- foreach $ constraintsUnder anything
-            constraintBetween curThis (I._exp cons)
-        where
-        constraintBetween _ I.IDeclPExp {I._quant = I.ISome, I._oDecls = [], I._bpexp} =
-            do
-                let t = map tLexeme $ fromMaybe [] $ unfoldJoins bpexp
-                guard (not $ null t)
-                guard ("this" `notElem` t)
-                guard ("parent" `notElem` t)
-                guard ("ref" `notElem` t)
-                msum $ map someStep t
-        constraintBetween curThis I.IFunExp{I._op = "&&", I._exps = [exp1, exp2]} =
-            constraintBetween curThis (I._exp exp1) `mplus` constraintBetween curThis (I._exp exp2)
-        constraintBetween _ _ = mzero
-        someStep step =
-            do
-                parent <- parentOf step
-                let parentBetween = fromMaybe (error $ "Missing parent " ++ parent) $ lookup parent analysis
-                guard $ atLeastOne parentBetween
-                return (step, Between 1 $ -1)
--}
-
-
-setConstraints :: ScopeAnalysis ()
-setConstraints =
-  do
-    simpleAnalysis
-    p <- flatten
-    withExtraClafers p $ do
-        optFormula
-        colonConstraints
-        refConstraints
-        parentConstraints
-        constraintConstraints
-
-    (var rootIdent) `equalTo` 1
-
-
-optFormula :: ScopeAnalysis ()
-optFormula =
-  do
-    setDirection Min
-    c <- clafers
-    let concretes = [uid concrete | concrete <- c, isConcrete concrete, isDerived concrete, not $ uniqNameSpace `isPrefixOf` uid concrete]
-    setObjective $ varSum concretes
-
-parentConstraints :: ScopeAnalysis ()
-parentConstraints =
-  runListT_ $ do
-    -- forall child under parent ...
-    (child, parent) <- foreach $ anything |^ anything
-
-    let uchild = uid child
-    let uparent = uid parent
-
-    if low child == high child
-        -- Saves us one constraint
-        then do
-            var uchild `equal` (low child *^ var uparent)
-        else do
-            -- ... scope_this <= scope_parent * low-card(this) ...
-            var uchild `geq` (low child *^ var uparent)
-            -- ... scope_this >= scope_parent * high-card(this) ...
-            -- high == -1 implies high card is unbounded
-
-            if high child /= -1
-              then var uchild `leq` (high child *^ var uparent)
-              {-
-               - A
-               -   B *
-               - [#B = 4]
-               -
-               - Need this constraint so that #A=1
-               -}
-              else (smallM *^ var uchild) `leq` var uparent
-            -- Use integer's not doubles
-            setVarKind uchild IntVar
-            setVarKind uparent IntVar
-
-
-refConstraints :: ScopeAnalysis ()
-refConstraints =
-  runListT_ $ do
-    -- for all uids of any clafer the refs another uid ...
-    (sub, sup) <- foreach $ (anything |-> anything) `suchThat` (isDerived . superClafers)
-    let usub = uid sub
-    let usup = uid sup
-    aux <- testPositive usub
-    -- scope_sup >= low-card(sub)
-    var usup `geq` ((max 1 $ low sub) *^ var aux)
-
-
-colonConstraints :: ScopeAnalysis ()
-colonConstraints =
-  runListT_ $ do
-    -- forall c in the set of clafers' uid ...
-    c <- foreach $ clafers `suchThat` isDerived
-    -- ... find all uids of any clafer that extends c (only colons) ...
-    subs <- findAll $ (anything |: c) `select` (uid . subClafers)
-    when (not $ null subs) $
-      -- ... then set the constraint scope_C = sum scope_subs
-      var (uid c) `equal` varSum subs
-
-
-
-flatten :: ScopeAnalysis [SClafer]
-flatten =
-    runListT $ do
-        abs' <- clafers `suchThat` isAbstract
-        (c, s) <- foreach $ anything |: anything
-        ListT $ runReaderT (addChildren (map uid abs') (Part [uid c, uid s]) (Part [])) []
-
-addChildren :: MonadAnalysis m => [String] -> Part -> Part -> m [SClafer]
-addChildren abs' (Part steps) ss@(Part supSteps) =
-    do
-        let parBase = last steps
-
-        chis <- directChildrenOf parBase
-        achis <- forM chis $
-            \chi -> do
-                let chiP = Part $ init steps ++ [chi]
-                let par  = Part steps
-                let supP = Part $ supSteps ++ [chi]
-
-                chiC <- claferWithUid chi
-                let s = SClafer (reifyPartName chiP) chi False (low chiC) (high chiC) (groupLow chiC) (groupHigh chiC) (Just $ reifyPartName par) (Just $ reifyPartName supP) Nothing (constraints chiC)
-                return s <:> addChildren abs' chiP ss
-
-        col <- runMaybeT $ colonOf parBase
-        case col of
-            Just col' -> do
-                acol <- addChildren abs' (Part $ steps ++ [col']) (Part $ supSteps ++ [parBase])
-                return $ concat achis ++ acol
-            Nothing -> return $ concat achis
-    where
-    notAbs = not . (`elem` abs')
-    reifyPartName (Part (t : target)) = reifyPartName' $ t : filter notAbs target
-    reifyPartName (Part []) = error "Function reifyPartName from GLPKScopeAnalyzer expects a non empty Part, but was given one!" -- This should never happen
-    reifyPartName' [target] = target
-    reifyPartName' target   = uniqNameSpace ++ "reify_" ++ intercalate "_" target
-
-
-data Path =
-  Path {parts::[Part]}
-  deriving (Eq, Ord, Show)
-
-data Part =
-  Part {steps::[String]}
-  deriving (Eq, Ord, Show)
-
-
-{-data Expr =
-    This {path::Path, eType::I.IType} |
-    Global {path::Path, eType::I.IType} |
-    Const Integer |
-    Concat {paths::[Expr], eType::I.IType} |
-    Positive {allPaths :: [Path], num::Integer, eType::I.IType}
-    deriving Show-}
-
-data Expr =
-    This Path I.IType |
-    Global Path I.IType |
-    Const Integer |
-    Concat [Expr] I.IType |
-    Positive [Path] Integer I.IType
-    deriving Show
-
-eType :: Expr -> I.IType
-eType (This _ e) = e
-eType (Global _ e) = e
-eType (Concat _ e) = e
-eType (Positive _ _ e) = e
-eType (Const _) = error "Function eType from GLPK did not expect a Const"
-
-isThis :: Expr -> Bool
-isThis This{} = True
-isThis _ = False
-isGlobal :: Expr -> Bool
-isGlobal Global{} = True
-isGlobal _ = False
-{-isConst :: Expr -> Bool
-isConst Const{} = True
-isConst _ = False-}
-
-parentOfPart :: MonadAnalysis m => Part -> m Part
-parentOfPart (Part s) =
-  do
-    s' <- parentOf $ last s
-    cs' <- claferWithUid s'
-    return $ if isAbstract cs'
-      then Part $ init s
-      else Part $ init s ++ [s']
-
-
-{-
- - Turns constraints that look like:
- -
- -  [ A in List
- -    B in List ]
- -
- - to
- -
- -  [ A, B in List ]
- -}
-optimizeInConstraints :: [I.PExp] -> [I.PExp]
-optimizeInConstraints constraints =
-    noOpt ++ opt
-    where
-    (noOpt, toOpt) = partitionEithers (constraints >>= partitionConstraint)
-    opt = [ unionPExpAll (map fst inSame) `inPExp` snd (head inSame)
-            | inSame <- groupBy (testing' $ syntaxOf . snd) $ sortBy (comparing' snd) toOpt ]
-    inPExp a b = I.PExp (Just I.TBoolean) "" noSpan $ I.IFunExp "in" [a, b]
-    unionPExpAll es = foldr1 unionPExp es
-    unionPExp a b = I.PExp (liftM2 (+++) (I._iType a) (I._iType b)) "" noSpan $ I.IFunExp "++" [a, b]
-
-    partitionConstraint I.PExp{I._exp = I.IFunExp {I._op = "in", I._exps = [exp1, exp2]}} = return $ Right (exp1, exp2)
-    partitionConstraint I.PExp{I._exp = I.IFunExp {I._op = "&&", I._exps = [exp1, exp2]}} = partitionConstraint exp1 `mplus` partitionConstraint exp2
-    partitionConstraint e = return $ Left e
-
-    testing'   f a b = f a == f b
-    comparing' f a b = f a `compare` f b
-
-
-{-
- -   Phone *
- -
- -   [all p : Phone | <constraint on p>]
- -
- - becomes
- -
- -   Phone *
- -      [<constraint on p/this>]
- -}
-optimizeAllConstraints :: MonadAnalysis m => SClafer -> [I.PExp] -> m [(SClafer, I.PExp)]
-optimizeAllConstraints curThis constraints =
-    runListT $ partitionConstraint =<< foreachM constraints
-    where
-    partitionConstraint I.PExp{I._exp = I.IDeclPExp I.IAll [I.IDecl _ [decl] I.PExp{I._exp = I.IClaferId{I._sident}}] bpexp} =
-        do
-            under <- claferWithUid _sident
-            return (under, rename decl bpexp)
-    partitionConstraint I.PExp{I._exp = I.IFunExp {I._op = "&&", I._exps = [exp1, exp2]}} = partitionConstraint exp1 `mplus` partitionConstraint exp2
-    partitionConstraint e = return (curThis, e)
-
-    rename :: String -> I.PExp -> I.PExp
-    rename f p@I.PExp{I._exp = exp'} =
-        p{I._exp = renameIExp exp'}
-        where
-        renameIExp (I.IFunExp op exps) = I.IFunExp op $ map (rename f) exps
-        renameIExp (I.IDeclPExp quant oDecls bpexp) = I.IDeclPExp quant (map renameDecl oDecls) $ rename f bpexp
-        renameIExp (I.IClaferId modName sident isTop bind)
-            | f == sident = I.IClaferId modName "this" isTop bind
-            | otherwise   = I.IClaferId modName sident isTop bind
-        renameIExp i = i
-        renameDecl (I.IDecl isDisj decls body)
-            | f `elem` decls = I.IDecl isDisj decls body -- Not a free variable
-            | otherwise      = I.IDecl isDisj decls $ rename f body -- Is a free variable
-
-optConstraintsUnder :: MonadAnalysis m => SClafer -> m [(SClafer, [I.PExp])]
-optConstraintsUnder clafer =
-    do
-        cons <- constraintsUnder clafer `select` snd
-        allCons <- optimizeAllConstraints clafer cons
-        let inCons = [(fst $ head c, optimizeInConstraints $ map snd c) | c <- groupBy (testing' $ uid . fst) $ sortBy (comparing' $ uid . fst) allCons]
-        return inCons
-    where
-    testing' f a b = f a == f b
-    comparing' f a b = f a `compare` f b
-
-
-constraintConstraints :: MonadScope m => m ()
-constraintConstraints =
-  do
-    runListT_ $ do
-      clafer <- foreach clafers
-      (supThis, cons) <- foreach $ optConstraintsUnder clafer
-
-      con <- foreachM cons
-      curThis <-
-          if isAbstract supThis
-              then
-                  foreach $ colonsTo supThis
-              else
-                  return supThis
-      constraint <- foreach $ scopeConstraint curThis con
-
-      oneConstraint curThis constraint
-  where
-  --base (Part steps) = last steps
-
-  oneConstraint c (e1, con, e2) =
-    void $ runMaybeT $ oneConstraintOneWay c e1 con e2 `mplus` oneConstraintOneWay c e2 (reverseCon con) e1
-
-  oneConstraintOneWay c@SClafer{uid} e1 con e2 =
-    oneConstraint' e1 e2
-    where
-    oneConstraint' _ (This (Path []) _) =
-      mzero
-    oneConstraint' _ (Global (Path []) _) =
-      mzero
-    oneConstraint' (This (Path []) _) (This (Path parts) _) =
-      return (var uid) `comp` reifyVar (last parts)
-    oneConstraint' (This (Path []) _) (Global (Path parts) _) =
-      return (var uid) `comp` reifyVar (last parts)
-    oneConstraint' (Positive [Path []] _ _) _ =
-      mzero
-    oneConstraint' _ (Positive [Path []] _ _) =
-      mzero
-    oneConstraint' (Global (Path gParts) _) (Positive allPaths claf _) =
-      do
-        aux <- testPositives (map (reifyVarName . last . parts) allPaths)
-        reifyVar (last gParts) `comp` return (claf *^ var aux)
-    oneConstraint' (This (Path parts) _) (Const constant)
-      | con == EQU            = oneConstraintOneWay c e1 LEQ e2 >> oneConstraintOneWay c e1 GEQ e2
-      | con `elem` [GTH, GEQ] = foldM_ mkCon 1 (reverse parts)
-      | con `elem` [LTH, LEQ] = reifyVar (last parts) `comp` (return $ (fromInteger constant :: Double) *^ var uid)
-      where
-      mkCon :: MonadScope m => Integer -> Part -> m Integer
-      mkCon multiplier part =
-        do
-          let frac = (1 / fromInteger multiplier) * fromInteger constant :: Double
-          (reifyVar part) `comp` return (frac *^ var uid)
-          mult multiplier <$> prod part
-    oneConstraint' (Global (Path parts) _) (Const constant)
-      | con == EQU            = oneConstraintOneWay c e1 LEQ e2 >> oneConstraintOneWay c e1 GEQ e2
-      | con `elem` [GTH, GEQ] =
-          do
-            k <- testPositive uid
-            foldM_ (mkCon k) 1 (reverse parts)
-      | con `elem` [LTH, LEQ] = reifyVar (last parts) `compTo` (return $ fromInteger constant)
-      where
-      mkCon :: MonadScope m => String -> Integer -> Part -> m Integer
-      mkCon pos (-1) part =
-        do
-          (reifyVar part) `comp` return (var pos)
-          return (-1)
-      mkCon pos multiplier part =
-        do
-          let frac = (1 / fromInteger multiplier) * fromInteger constant :: Double
-          (reifyVar part) `comp` return (frac *^ var pos)
-          mult multiplier <$> prod part
-
-    oneConstraint' (This (Path parts1) _) (This (Path parts2) _) =
-      reifyVar (last parts1) `comp` reifyVar (last parts2)
-    oneConstraint' (Global (Path parts1) _) (Global (Path parts2) _) =
-      reifyVar (last parts1) `comp` reifyVar (last parts2)
-    oneConstraint' (Global (Path parts) _) (Concat exprs _) =
-      if all isGlobal exprs
-        then reifyVar (last parts) `comp` reifyVars [last p | Global (Path p) _ <- exprs]
-        else mzero
-    oneConstraint' (This (Path parts) _) (Concat exprs _) =
-      if all isGlobal exprs
-        then do
-          let vs = [last p | Global (Path p) _ <- exprs]
-          claf <- mapM (claferWithUid . last . steps) $ vs
-          s <- mapM constantCard claf
-          p <- parentOfPart $ last parts
-          reifyVar (last parts) `comp` ((sum s *^) <$> reifyVar p)
-        else if all isThis exprs
-          then reifyVar (last parts) `comp` reifyVars [last p | This (Path p) _ <- exprs]
-          else mzero
-    oneConstraint' _ _ = mzero
-
-    constantCard SClafer{low, high}
-      | low == high = return low
-      | otherwise   = mzero
-
-    prod (Part steps) = foldr1 mult <$> mapM (return . high <=< claferWithUid) steps
-
-    comp x y =
-      do
-        x' <- x
-        y' <- y
-        case con of
-          LTH -> (x' ^-^ y') `leqTo` (-smallM)
-          LEQ -> x' `leq` y'
-          EQU -> x' `equal` y'
-          GTH -> (x' ^-^ y') `geqTo` smallM
-          GEQ -> x' `geq` y'
-    compTo x y =
-      do
-        x' <- x
-        y' <- y
-        case con of
-          LTH -> x' `leqTo` (y' - smallM)
-          LEQ -> x' `leqTo` y'
-          EQU -> x' `equalTo` y'
-          GTH -> x' `geqTo` (y' + smallM)
-          GEQ -> x' `geqTo` y'
-
-  reifyVar p  = return (var $ reifyVarName p)
-  reifyVars p = return (varSum $ map reifyVarName p)
-  reifyVarName (Part [target]) = target
-  reifyVarName (Part target)   = uniqNameSpace ++ "reify_" ++ intercalate "_" target
-{-
-  isAbstractPart (Part [_]) = False
-  isAbstractPart _ = True
-
-  reifiedSuper (Part steps) =
-    do
-      let (b : s : rest) = reverse steps
-      ss <- colonOf s
-      sss <- runMaybeT $ colonUid ss
-      if isNothing sss
-        then return $ Part $ reverse $ b : rest
-        else return $ Part $ reverse $ b : ss : rest
-
-  -- TODO: correct?
-
-  siblingParts (Part (conc : abst)) =
-    do
-      conc' <- claferWithUid conc
-      sup   <- runMaybeT $ colonOf conc'
-      case sup of
-        Nothing -> return [Part $ conc : abst]
-        Just sup' -> runListT $ do
-            (sub, _) <- foreach $ anything |: sup'
-            return $ Part $ uid sub : abst
-  siblingParts [] = error "Function siblingParts from GLpkScopeAnalyzer expects a non empty list, given an empty one!" -- This should never happen
-
-  reifyPart (Part steps) =
-    do
-      as <- claferWithUid (last steps) >>= nonTopAncestors
-      forM as $
-        \a -> return $ Part $ init steps ++ [uid a]
-
-  nonTopAncestors child =
-    do
-      parent <- parentOf child
-      if uid parent == rootIdent
-        then return []
-        else (++ [child]) `fmap` nonTopAncestors parent
- -}
-
-data Con = EQU | LTH | LEQ | GTH | GEQ deriving (Eq, Ord, Show)
-
-reverseCon :: Con -> Con
-reverseCon EQU = EQU
-reverseCon LTH = GTH
-reverseCon LEQ = GEQ
-reverseCon GTH = LTH
-reverseCon GEQ = LEQ
-data Limit = Exact {lExpr::Expr} | AtLeast {lExpr::Expr} deriving Show
-
-scopeConstraint :: MonadScope m => SClafer -> I.PExp -> m [(Expr, Con, Expr)]
-scopeConstraint curThis pexp =
-  runListT $ scopeConstraint' $ I._exp pexp
-  where
-  scopeConstraint' I.IFunExp {I._op = "&&", I._exps} = msum $ map (scopeConstraint' . I._exp) _exps
-  scopeConstraint' I.IDeclPExp {I._quant = I.ISome, I._oDecls = [], I._bpexp} = parsePath curThis _bpexp `greaterThanEqual` constant (1::Integer)
-  scopeConstraint' I.IDeclPExp {I._quant = I.ISome, I._oDecls}               = msum $ map pathAndMultDecl _oDecls
-      where
-      pathAndMultDecl I.IDecl {I._isDisj = True, I._decls, I._body} = parsePath curThis _body `greaterThanEqual` constant (length _decls)
-      pathAndMultDecl I.IDecl {I._isDisj = False, I._body}         = parsePath curThis _body `greaterThanEqual` constant (1::Integer)
-  scopeConstraint' I.IDeclPExp {I._quant = I.IOne, I._oDecls = [], I._bpexp} = parsePath curThis _bpexp `eqTo` constant (1::Integer)
-  scopeConstraint' I.IDeclPExp {I._quant = I.IOne, I._oDecls} =
-    do
-      oDecl <- foreachM _oDecls
-      parsePath curThis (I._body oDecl) `eqTo` constant (1::Integer)
-  scopeConstraint' I.IFunExp {I._op, I._exps = [exp1, exp2]}
-    | _op == "in" = inConstraint1 exp1 exp2 `mplus` inConstraint2 exp1 exp2
-    | _op == "="  = equalConstraint1 exp1 exp2 `mplus` equalConstraint2 exp1 exp2
-    | _op == "<"  = scopeConstraintNum exp1 `lessThan` scopeConstraintNum exp2
-    | _op == "<=" = scopeConstraintNum exp1 `lessThanEqual` scopeConstraintNum exp2
-    | _op == ">"  = scopeConstraintNum exp1 `greaterThan` scopeConstraintNum exp2
-    | _op == ">=" = scopeConstraintNum exp1 `greaterThanEqual` scopeConstraintNum exp2
-    | _op == "<=>" = (exp1 `implies` exp2) `mplus` (exp2 `implies` exp1)
-    | _op == "=>" = exp1 `implies` exp2
-  scopeConstraint' _ = mzero
-
-  implies exp1 exp2 =
-    do
-      e1 <- scopeConstraint' $ I._exp exp1
-      e2 <- scopeConstraint' $ I._exp exp2
-
-      case (e1, e2) of
-        ((This thisPath t1, GEQ, Const 1), (Global globalPath t0, comp, Positive allPaths c t2)) ->
-          return $ (Global globalPath t0, comp, Positive (thisPath : allPaths) c $ t1 +++ t2)
-        ((This thisPath e1', GEQ, Const 1), (Global globalPath e2', comp, Const c)) ->
-          return $ (Global globalPath e2', comp, Positive [thisPath] c e1')
-        ((Global path1 t1, GEQ, Const 1), (Global path2 t0, comp, Positive allPaths c t2)) ->
-          return $ (Global path2 t0, comp, Positive (path1 : allPaths) c $ t1 +++ t2)
-        ((Global path1 e1', GEQ, Const 1), (Global path2 e2', comp, Const c)) ->
-          return $ (Global path2 e2', comp, Positive [path1] c e1')
-        ((t1@(This (Path [thisPart1]) _), GEQ, Const 1), (t2@(This (Path [_]) _), GEQ, Const 1)) ->
-            do
-                c <- claferWithUid $ last $ steps thisPart1
-                guard (high c == 1)
-                return (t2, GEQ, t1)
-        _ -> mzero
-
-  equalConstraint1 exp1 exp2 =
-    do
-      l1 <- scopeConstraintSet exp1
-      l2 <- scopeConstraintSet exp2
-      case (l1, l2) of
-        (Exact e1, Exact e2)   -> return e1 `eqTo` return e2
-        (AtLeast e1, Exact e2) -> return e1 `greaterThanEqual` return e2
-        (Exact e1, AtLeast e2) -> return e1 `lessThanEqual` return e2
-        _ -> mzero
-  equalConstraint2 exp1 exp2 = scopeConstraintNum exp1 `eqTo` scopeConstraintNum exp2
-
-  -- exp1 in exp2
-  inConstraint1 exp1 exp2 =
-    do
-      l1 <- scopeConstraintSet exp1
-      l2 <- scopeConstraintSet exp2
-
-      case l2 of
-        Exact e2 -> return (lExpr l1) `lessThanEqual` return e2
-        _ -> mzero
-  inConstraint2 exp1 exp2 = scopeConstraintNum exp1 `lessThanEqual` scopeConstraintNum exp2
-
-  scopeConstraintSet I.PExp {I._exp = I.IFunExp {I._op = "++", I._exps = [e1, e2]}} =
-    do
-      l1' <- scopeConstraintSet e1
-      l2' <- scopeConstraintSet e2
-      i   <- intersects (eType $ lExpr l1') (eType $ lExpr l2')
-      if i
-        then return $ AtLeast $ lExpr l1'
-        else return $ combineDisjoint l1' l2'
-  scopeConstraintSet x = Exact <$> parsePath curThis x
-
-  combineDisjoint (Exact e1) (Exact e2) =
-    Exact (Concat ([e1, e2] >>= flattenConcat) $ eType e1 +++ eType e2)
-  combineDisjoint l1 l2 =
-    AtLeast (Concat ([e1, e2] >>= flattenConcat) $ eType e1 +++ eType e2)
-    where
-    e1 = lExpr l1
-    e2 = lExpr l2
-
-
-  flattenConcat (Concat es _) = es >>= flattenConcat
-  flattenConcat e = [e]
-
-  scopeConstraintNum I.PExp {I._exp = I.IInt const'} = constant const'
-  scopeConstraintNum I.PExp {I._exp = I.IFunExp {I._op = "#", I._exps = [path]}} = parsePath curThis path
-  scopeConstraintNum _ = mzero
-
-  constant :: (Monad m, Integral i) => i -> m Expr
-  constant = return . Const . toInteger
-
-  greaterThan = liftM2 (,GTH,)
-  greaterThanEqual = liftM2 (,GEQ,)
-  lessThan = liftM2 (,LTH,)
-  lessThanEqual = liftM2 (,LEQ,)
-  eqTo = liftM2 (,EQU,)
-
-
-{-
- - We use the stack to push every abstraction we traverse through.
- - For example:
- -
- -  abstract A
- -    B ?
- -      C : D ?
- -  abstract D
- -    E ?
- -  F : A
- -  G : A
- -  H : A
- -
- -  [some F.B.C.E]
- -  [some G.B.C.E]
- -
- - The first constraint's final stack will look like ["C" ,"F"]
- - Hence the linear programming equation will look like:
- -
- -  scope_F_C_E >= scope_root
- -
- - Adding the second constraint:
- -
- -  scope_G_C_E >= scope_root
- -  scope_E >= scope_F_C_E + scope_G_C_E (*)
- -
- - Solving the minimization should have scope_E = 2 in its solution.
- - The (*) equation is set in constraintConstraints
- -}
-parsePath :: MonadScope m => SClafer -> I.PExp -> m Expr
-parsePath start pexp =
-    do
-        start' <- claferWithUid (origUid start)
-        parsePath2 start' pexp
-
-parsePath2 :: MonadScope m => SClafer -> I.PExp -> m Expr
-parsePath2 start pexp =
-  do
-    root <- claferWithUid rootIdent
-    case unfoldJoins pexp of
-        Just unfold -> do
-            match <- patternMatch parsePath' (ParseState root []) unfold
-            either (fail . show) return match
-        Nothing     -> fail "Cannot unfold."
-  where
-  asPath :: [[String]] -> Path
-  asPath parts = Path [Part part | part <- parts, not $ null part]
-
-  parsePath' = (This <$> (asPath <$> parseThisPath) <*> getThisType) <|> (Global <$> (asPath <$> parseNonthisPath) <*> getThisType)
-
-  getThisType =
-    do
-        t <- getThis
-        return $ fromJust $ fromUnionType [uid t]
-
-  parseThisPath =
-    do
-      t <- _this_
-      do
-        many1 _parent_
-        return [[uid start]]
-        <|> (follow t >> parseNonthisPath)
-  parseNonthisPath =
-    do
-      paths <- many (step >>= follow)
-
-      lifo <- popStack
-      let end = if null paths then [] else [last paths]
-      let result = reverse $ end ++ map uid lifo
-
-      do
-        _ref_ >>= follow
-        -- recurse
-        rec <- parseNonthisPath
-        return $ result : rec
-        <|> return [result]
-
-  -- Step handles non-this token.
-  step :: MonadScope m => ParseT m String
-  step = _parent_ <|> _directChild_ <|> try (pushThis >> _indirectChild_)
-
-  -- Update the state of where "this" is.
-  -- Path is one step away from where "this" is.
-  follow :: MonadScope m => String -> ParseT m String
-  follow path =
-    do
-      curThis <- getThis
-      case path of
-        "this" -> putThis start
-        "parent" -> lift (parentOf curThis) >>= putThis -- the parent is now "this"
-        "ref" -> lift (refOf curThis) >>= putThis -- the ref'd Clafer is now "this"
-        u -> lift (claferWithUid u) >>= putThis
-      return path
-
-
-
-
-
-{------------------------------------------------------------
- ---------- Internals ---------------------------------------
- ------------------------------------------------------------}
-
-newtype ScopeAnalysis a = ScopeAnalysis (VSupplyT (AnalysisT (LPM String Double)) a)
-  deriving (Monad, Functor, MonadState (LP String Double), MonadSupply Var, MonadReader Info, MonadAnalysis)
-
-class (MonadAnalysis m, MonadState (LP String Double) m, MonadSupply Var m) => MonadScope m
-
-instance (MonadAnalysis m, MonadState (LP String Double) m, MonadSupply Var m) => MonadScope m
-
-
-runScopeAnalysis :: ScopeAnalysis a -> Info -> (a, LP String Double)
-runScopeAnalysis (ScopeAnalysis s) info = runLPM $ runAnalysisT (runVSupplyT s) info
-
--- Unfold joins
--- If the expression is a tree of only joins, then this function will flatten
--- the joins into a list.
--- Otherwise, returns an empty list.
-unfoldJoins :: Monad m => I.PExp -> m [Token]
-unfoldJoins pexp =
-    unfoldJoins' pexp
-    where
-    unfoldJoins' I.PExp{I._exp = (I.IFunExp "." args)} =
-        return $ args >>= (fromMaybe [] . unfoldJoins)
-    unfoldJoins' I.PExp{I._inPos, I._exp = I.IClaferId{I._sident}} =
-        return $ [Token (spanToSourcePos _inPos) _sident]
-    unfoldJoins' _ =
-        fail "not a join"
-
-
--- Variables starting with "_aux_" are reserved for creating
--- new variables at runtime.
-uniqNameSpace :: String
-uniqNameSpace = "_aux_"
-
-uniqVar :: MonadScope m => m String
-uniqVar =
-  do
-    c <- supplyNew
-    return $ uniqNameSpace ++ show (varId c)
-
-{-
- - Create a new variable "aux". If
- -   v == 0 -> aux == 0
- -   v > 0  -> aux == 1
- -
- - pre: v >= 0 and v is integer
- -}
-testPositive :: MonadScope m => String -> m String
-testPositive v =
-  do
-    aux <- uniqVar
-    var aux `leq` var v
-    var aux `geq` (smallM *^ var v)
-    var aux `leqTo` 1
-    setVarKind aux IntVar
-    return aux
-
-{-
- - Create a new variable "aux". If
- -   all v == 0 -> aux == 0
- -   all v > 0  -> aux == 1
- -
- - pre: all v >= 0 and all v is integer
- -}
-testPositives :: MonadScope m => [String] -> m String
-testPositives [v] = testPositive v
-testPositives vs =
-  do
-    auxs <- mapM testPositive vs
-    aux <- uniqVar
-    (length vs *^ var aux) `equal` varSum auxs
-
-    a <- uniqVar
-    (var a ^-^ var aux) `geqTo` (-0.9999) -- Buffer for floating point inaccuracies
-    (var a ^-^ var aux) `leqTo` 0.0001    -- Buffer for floating point inaccuracies
-    setVarKind a IntVar
-    return a
-
-{-
- - smallM cannot be too small. For example, with glpk
- -   0.000001 * 9 = 0
- -}
-smallM :: Double
-smallM = 0.0005 -- 0.00001
-
-
-
-
-
-{-
- -
- - Parsing
- -
- -}
-data Token = Token {tPos::SourcePos, tLexeme::String} deriving Show
-
-data ParseState = ParseState
-  {psThis::SClafer, -- "this"
-   psStack::[SClafer] -- the list of all the abstract Clafers traversed
-   }
-   deriving Show
-type ParseT = ParsecT [Token] ParseState
-
-
--- Where "this" refers to.
-getThis :: MonadScope m => ParseT m SClafer
-getThis =
-  do
-    s <- getState
-    return (psThis s)
-
--- Update where "this" refers to.
-putThis :: MonadScope m => SClafer -> ParseT m ()
-putThis newThis =
-  do
-    state' <- getState
-    putState $ state'{psThis = newThis}
-
-popStack :: MonadScope m => ParseT m [SClafer]
-popStack =
-  do
-    state' <- getState
-    let stack = psStack state'
-    putState state'{psStack = []}
-    return stack
-
-pushThis :: MonadScope m => ParseT m ()
-pushThis =
-  do
-    state' <- getState
-    putState $ state'{psStack = psThis state' : psStack state'}
-
-
--- Parser combinator for "this"
-_this_ :: MonadScope m => ParseT m String
-_this_ = satisfy (== "this")
-
--- Parser combinator for "parent"
-_parent_ :: MonadScope m => ParseT m String
-_parent_ = satisfy (== "parent")
-
--- Parser combinator for "ref"
-_ref_ :: MonadScope m => ParseT m String
-_ref_ = satisfy (== "ref")
-
--- Parser combinator for a uid that is not "this", "parent", or "ref"
-_child_ :: MonadScope m => ParseT m String
-_child_ = satisfy (not . (`elem` ["this", "parent", "ref"]))
-
--- Parser combinator for a uid of direct child.
-_directChild_ :: MonadScope m => ParseT m String
-_directChild_ =
-  try $ do
-    curThis <- getThis
-    clafer <- _child_ >>= lift . claferWithUid
-    check <- lift $ isDirectChild clafer curThis
-    when (not check) $ unexpected $ (uid clafer) ++ " is not a direct child of " ++ (uid curThis)
-    return $ uid clafer
-
--- Parser combinator for a uid of indirect child.
-_indirectChild_ :: MonadScope m => ParseT m String
-_indirectChild_ =
-  try $ do
-    curThis <- getThis
-    clafer <- _child_ >>= lift . claferWithUid
-    check <- lift $ isIndirectChild clafer curThis
-    when (not check) $ unexpected $ (uid clafer) ++ " is not an indirect child of " ++ (uid curThis)
-    return $ uid clafer
-
-
-satisfy :: MonadScope m => (String -> Bool) -> ParseT m String
-satisfy f = tLexeme <$> tokenPrim (tLexeme)
-                                  (\_ c _ -> tPos c)
-                                  (\c -> if f $ tLexeme c then Just c else Nothing)
-
-
-spanToSourcePos :: Span -> SourcePos
-spanToSourcePos (Span (Pos l c) _) = (newPos "" (fromInteger l) (fromInteger c))
-
-patternMatch :: MonadScope m => ParseT m a -> ParseState -> [Token] -> m (Either ParseError a)
-patternMatch parse' state' =
-  runParserT (parse' <* eof) state' ""
-
-{-
- -
- - Utility functions
- -
- -}
-
-subexpressions :: I.PExp -> [I.PExp]
-subexpressions p@I.PExp{I._exp = exp'} =
-  p : subexpressions' exp'
-  where
-  subexpressions' I.IDeclPExp{I._oDecls, I._bpexp} =
-    concatMap (subexpressions . I._body) _oDecls ++ subexpressions _bpexp
-  subexpressions' I.IFunExp{I._exps} = concatMap subexpressions _exps
-  subexpressions' _ = []
-
-instance MonadSupply s m => MonadSupply s (ListT m) where
-  supplyNew = lift supplyNew
-
-instance MonadSupply s m => MonadSupply s (MaybeT m) where
-  supplyNew = lift supplyNew
-
-instance MonadSupply s m => MonadSupply s (ParsecT a b m) where
-  supplyNew = lift supplyNew
diff --git a/src/Language/Clafer/Intermediate/Intclafer.hs b/src/Language/Clafer/Intermediate/Intclafer.hs
--- a/src/Language/Clafer/Intermediate/Intclafer.hs
+++ b/src/Language/Clafer/Intermediate/Intclafer.hs
@@ -23,7 +23,7 @@
 -- | Intermediate representation (IR) of a Clafer model
 module Language.Clafer.Intermediate.Intclafer where
 
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 
 import Control.Lens
 import Data.Data
@@ -205,7 +205,7 @@
         /          - division
         ++         - set union
         \-\-         - set difference
-        &          - set intersection
+        **          - set intersection
         \<:         - domain restriction
         :\>         - range restriction
         .          - relational join
diff --git a/src/Language/Clafer/Intermediate/Resolver.hs b/src/Language/Clafer/Intermediate/Resolver.hs
--- a/src/Language/Clafer/Intermediate/Resolver.hs
+++ b/src/Language/Clafer/Intermediate/Resolver.hs
@@ -25,6 +25,7 @@
 import Control.Monad
 import Control.Monad.State
 import qualified Data.Map as Map
+import qualified Data.StringMap as SMap
 
 import Language.Clafer.Common
 import Language.Clafer.ClaferArgs
@@ -46,10 +47,13 @@
 
 -- | Name resolver
 nameModule :: Bool -> IModule -> (IModule, GEnv)
-nameModule skipResolver imodule = (imodule{_mDecls = decls'}, genv')
+nameModule skipResolver imodule = (imodule', genv'')
   where
-  (decls', genv') = runState (mapM (nameElement skipResolver "root") $ _mDecls imodule) $ GEnv Map.empty 0 Map.empty []
+    (decls', genv') = runState (mapM (nameElement skipResolver "root") $ _mDecls imodule) $ GEnv Map.empty 0 Map.empty [] SMap.empty
+    imodule' = imodule{_mDecls = decls'}
+    genv'' = genv'{uidClaferMap = createUidIClaferMap imodule'}
 
+
 nameElement :: MonadState GEnv m => Bool -> UID -> IElement -> m IElement
 nameElement skipResolver puid x = case x of
   IEClafer claf -> IEClafer `liftM` (nameClafer skipResolver puid claf)
@@ -87,10 +91,10 @@
 resolveNamesModule :: ClaferArgs -> (IModule, GEnv) -> Resolve (IModule, GEnv)
 resolveNamesModule args' (imodule, genv') =
   do
-    res <- foldM (flip ($)) imodule $ map (\f -> flip (curry f) genv') funs
-    return (res, genv')
+    imodule' <- foldM (flip ($)) imodule $ map (\f -> flip (curry f) genv') funs
+    return (imodule', genv'{uidClaferMap = createUidIClaferMap imodule'})
   where
   funs :: [(IModule, GEnv) -> Resolve IModule]
   funs
-    | skip_resolver args' = [return . analyzeModule, resolveTModule]
-    | otherwise = [ return . analyzeModule, resolveModuleNames, resolveTModule]
+    | skip_resolver args' = [return . analyzeModule, resolveRedefinition, resolveTModule]
+    | otherwise = [ return . analyzeModule, resolveModuleNames, resolveRedefinition, resolveTModule]
diff --git a/src/Language/Clafer/Intermediate/ResolverInheritance.hs b/src/Language/Clafer/Intermediate/ResolverInheritance.hs
--- a/src/Language/Clafer/Intermediate/ResolverInheritance.hs
+++ b/src/Language/Clafer/Intermediate/ResolverInheritance.hs
@@ -34,6 +34,7 @@
 
 import Language.ClaferT
 import Language.Clafer.Common
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Intclafer
 import Language.Clafer.Intermediate.ResolverName
 
@@ -44,21 +45,24 @@
   do
     let decls' = _mDecls imodule
     decls'' <- mapM (resolveNElement decls') decls'
-    return (imodule{_mDecls = decls''}, genv' {sClafers = bfs toNodeShallow $ toClafers decls''})
+    let imodule' = imodule{_mDecls = decls''}
+    return
+      ( imodule'
+      , genv'{sClafers = bfs toNodeShallow $ toClafers decls'', uidClaferMap = createUidIClaferMap imodule'})
 
 
 
 resolveNClafer :: [IElement] -> IClafer -> Resolve IClafer
 resolveNClafer declarations clafer =
   do
-    super'    <- resolveNSuper declarations $ _super clafer
+    (super', superIClafer')    <- resolveNSuper declarations $ _super clafer
     elements' <- mapM (resolveNElement declarations) $ _elements clafer
     return $ clafer {_super = super',
             _elements = elements'}
 
 
-resolveNSuper :: [IElement] -> Maybe PExp -> Resolve (Maybe PExp)
-resolveNSuper _ Nothing = return Nothing
+resolveNSuper :: [IElement] -> Maybe PExp -> Resolve (Maybe PExp, Maybe IClafer)
+resolveNSuper _ Nothing = return (Nothing, Nothing)
 resolveNSuper declarations (Just (PExp _ pid' pos' (IClaferId _ id' _ _))) =
     if isPrimitive id'
       then throwError $ SemanticErr pos' $ "Primitive types are not allowed as super types: " ++ id'
@@ -67,8 +71,9 @@
         (id'', [superClafer']) <- case r of
           Nothing -> throwError $ SemanticErr pos' $ "No superclafer found: " ++ id'
           Just m  -> return m
-        return $ Just $ idToPExp pid' pos' "" id'' $ isTopLevel superClafer'
-resolveNSuper _ x = return x
+        return $ (Just $ PExp (Just $ TClafer [id'']) pid' pos' (IClaferId "" id'' (isTopLevel superClafer') (Just $ id''))
+                 , Just superClafer')
+resolveNSuper _ x = return (x, Nothing)
 
 
 resolveNElement :: [IElement] -> IElement -> Resolve IElement
@@ -88,7 +93,9 @@
   do
     let decls' = _mDecls imodule
     decls'' <- mapM (resolveOElement (defSEnv genv' decls')) decls'
-    return (imodule {_mDecls = decls''}, genv' {sClafers = bfs toNodeShallow $ toClafers decls''})
+    let imodule' = imodule{_mDecls = decls''}
+    return ( imodule'
+           , genv'{sClafers = bfs toNodeShallow $ toClafers decls'', uidClaferMap = createUidIClaferMap imodule'})
 
 
 resolveOClafer :: SEnv -> IClafer -> Resolve IClafer
@@ -134,7 +141,7 @@
   where
   gcard'
     | isNothing $ _super clafer = _gcard clafer
-    | otherwise                 = listToMaybe $ mapMaybe _gcard $ findHierarchy getSuper (clafers env) clafer
+    | otherwise                 = listToMaybe $ mapMaybe _gcard $ findHierarchy getSuper (uidClaferMap $ genv env) clafer
 
 
 analyzeCard :: SEnv -> IClafer -> Maybe Interval
@@ -155,9 +162,11 @@
 
 -- | Expand inheritance
 resolveEModule :: (IModule, GEnv) -> (IModule, GEnv)
-resolveEModule (imodule, genv') = (imodule{_mDecls = decls''}, genv'')
+resolveEModule (imodule, genv') = (imodule', newGenv)
   where
   decls' = _mDecls imodule
+  imodule' = imodule{_mDecls = decls''}
+  newGenv = genv''{uidClaferMap = createUidIClaferMap imodule'}
   (decls'', genv'') = runState (mapM (resolveEElement []
                                     (unrollableModule imodule)
                                     False decls') decls') genv'
@@ -192,12 +201,12 @@
 -- -----------------------------------------------------------------------------
 resolveEClafer :: MonadState GEnv m => [String] -> [String] -> Bool -> [IElement] -> IClafer -> m IClafer
 resolveEClafer predecessors unrollables absAncestor declarations clafer = do
-  sClafers' <- gets sClafers
+  uidClaferMap' <- gets uidClaferMap
   clafer' <- renameClafer absAncestor (_parentUID clafer) clafer
   let predecessors' = _uid clafer' : predecessors
   (sElements, super', superList) <-
       resolveEInheritance predecessors' unrollables absAncestor declarations
-        (findHierarchy getSuper sClafers' clafer)
+        (findHierarchy getSuper uidClaferMap' clafer)
   let sClafer = Map.fromList $ zip (map _uid superList) $ repeat [predecessors']
   modify (\e -> e {stable = Map.delete "clafer" $
                             Map.unionWith ((nub.).(++)) sClafer $
@@ -243,3 +252,33 @@
     resolveEClafer predecessors unrollables absAncestor declarations clafer
   IEConstraint _ _  -> return x
   IEGoal _ _ -> return x
+
+-- -----------------------------------------------------------------------------
+
+resolveRedefinition :: (IModule, GEnv) -> Resolve IModule
+resolveRedefinition    (iModule, _)  =
+  if (not $ null improperClafers)
+    then throwError $ SemanticErr noSpan ("Refinement errors in the following places:\n" ++  improperClafers)
+    else return iModule
+  where
+    uidIClaferMap' = createUidIClaferMap iModule
+    improperClafers :: String
+    improperClafers = foldMapIR isImproper iModule
+
+    isImproper :: Ir -> String
+    isImproper (IRClafer claf@IClafer{_cinPos = (Span (Pos l c) _) ,_ident=i}) =
+      let
+        match = matchNestedInheritance uidIClaferMap' claf
+      in
+        if (isProperNesting uidIClaferMap' match)
+        then let
+               (properCardinalityRefinement, properBagToSetRefinement, properTargetSubtyping) = isProperRefinement uidIClaferMap' match
+             in if (properCardinalityRefinement)
+             then if (properBagToSetRefinement)
+                  then if (properTargetSubtyping)
+                       then ""
+                       else ("Improper target subtyping for clafer '" ++ i ++ "' on line " ++ show l ++ " column " ++ show c ++ "\n")
+                  else ("Improper bag to set refinement for clafer '" ++ i ++ "' on line " ++ show l ++ " column " ++ show c ++ "\n")
+             else ("Improper cardinality refinement for clafer '" ++ i ++ "' on line " ++ show l ++ " column " ++ show c ++ "\n")
+        else ("Improperly nested clafer '" ++ i ++ "' on line " ++ show l ++ " column " ++ show c ++ "\n")
+    isImproper _ = ""
diff --git a/src/Language/Clafer/Intermediate/ResolverName.hs b/src/Language/Clafer/Intermediate/ResolverName.hs
--- a/src/Language/Clafer/Intermediate/ResolverName.hs
+++ b/src/Language/Clafer/Intermediate/ResolverName.hs
@@ -26,7 +26,7 @@
 import Control.Applicative
 import Control.Monad
 import Control.Monad.Error
-import Control.Monad.Maybe
+import Control.Monad.Trans.Maybe
 import Control.Monad.State
 import Data.Maybe
 import Data.Function
@@ -38,16 +38,17 @@
 import qualified Language.Clafer.Intermediate.Intclafer as I
 
 -- | this environment is created for each clafer
-data SEnv = SEnv {
-  clafers :: [IClafer],                 -- (constant) top level clafers
-  context :: Maybe IClafer,             -- context of a constraint
-  subClafers :: [(IClafer, [IClafer])], -- descendans (BFS)
-  ancClafers :: [(IClafer, [IClafer])], -- ancesors (BFS)
-  bindings :: [([String], [IClafer])],  -- local names
-  resPath :: [IClafer],                 -- path to the current clafer
-  genv :: GEnv,                         -- (constant)
-  aClafers :: [(IClafer, [IClafer])],   -- (constant) abstract clafers (BFS)
-  cClafers :: [(IClafer, [IClafer])]    -- (constant) all concrete clafers (BFS)
+data SEnv
+  = SEnv
+  { clafers :: [IClafer]                 -- (constant) top level clafers
+  , context :: Maybe IClafer             -- context of a constraint
+  , subClafers :: [(IClafer, [IClafer])] -- descendans (BFS)
+  , ancClafers :: [(IClafer, [IClafer])] -- ancesors (BFS)
+  , bindings :: [([String], [IClafer])]  -- local names
+  , resPath :: [IClafer]                 -- path to the current clafer
+  , genv :: GEnv                         -- (constant)
+  , aClafers :: [(IClafer, [IClafer])]   -- (constant) abstract clafers (BFS)
+  , cClafers :: [(IClafer, [IClafer])]   -- (constant) all concrete clafers (BFS)
   } deriving Show
 
 -- | How a given name was resolved
@@ -176,7 +177,7 @@
     (exp', path') <- resolveNav (_inPos pexp) env {context = listToMaybe path, resPath = path}
                      (I._exp pexp) False
     return (IFunExp iJoin [pexp0{I._exp=exp0'}, pexp{I._exp=exp'}], path')
-  IClaferId modName' id' _ _-> out
+  IClaferId modName' id' _ _ -> out
     where
     out
       | isFirst   = mkPath env <$> resolveName pos' env id'
@@ -210,7 +211,6 @@
 toNav' :: [(String, Maybe IClafer)] -> IExp
 toNav' p = (mkIFunExp iJoin $ map (\(id', cbind) -> IClaferId "" id' False (_uid <$> cbind)) p) :: IExp
 
-
 adjustAncestor :: IClafer -> [(String, Maybe IClafer)] -> [(String, Maybe IClafer)] -> [(String, Maybe IClafer)]
 adjustAncestor ctx cPath rPath = (thisIdent, Just ctx) : parents ++ (fromJust $ stripPrefix prefix rPath)
   where
@@ -334,7 +334,7 @@
 
 selectChildren :: (IClafer -> [String]) -> SEnv -> [IClafer]
 selectChildren f env = getSubclafers $ concat $
-                       mapHierarchy _elements f (sClafers $ genv env)
+                       mapHierarchy _elements f (uidClaferMap $ genv env)
                        (fromJust $ context env)
 
 findUnique :: Span -> String -> [(IClafer, [IClafer])] -> Resolve (Maybe (String, [IClafer]))
diff --git a/src/Language/Clafer/Intermediate/ResolverType.hs b/src/Language/Clafer/Intermediate/ResolverType.hs
--- a/src/Language/Clafer/Intermediate/ResolverType.hs
+++ b/src/Language/Clafer/Intermediate/ResolverType.hs
@@ -1,7 +1,6 @@
-{-# LANGUAGE NamedFieldPuns, ScopedTypeVariables, FlexibleContexts, FlexibleInstances, UndecidableInstances, GeneralizedNewtypeDeriving #-}
-
+{-# LANGUAGE NamedFieldPuns, FlexibleInstances, GeneralizedNewtypeDeriving #-}
 {-
- Copyright (C) 2012-2013 Jimmy Liang, Kacper Bak <http://gsd.uwaterloo.ca>
+ Copyright (C) 2012-2015 Jimmy Liang, Kacper Bak, Michal Antkiewicz <http://gsd.uwaterloo.ca>
 
  Permission is hereby granted, free of charge, to any person obtaining a copy of
  this software and associated documentation files (the "Software"), to deal in
@@ -21,14 +20,14 @@
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
 -}
-module Language.Clafer.Intermediate.ResolverType (resolveTModule, intersects, (+++), fromUnionType, unionType)  where
+module Language.Clafer.Intermediate.ResolverType (resolveTModule)  where
 
 import Prelude hiding (exp)
 import Language.ClaferT
 import Language.Clafer.Common
-import Language.Clafer.Intermediate.Analysis
 import Language.Clafer.Intermediate.Intclafer hiding (uid)
-import qualified Language.Clafer.Intermediate.Intclafer as I
+import Language.Clafer.Intermediate.Desugarer
+import Language.Clafer.Front.PrintClafer
 
 import Control.Applicative
 import Control.Exception (assert)
@@ -40,7 +39,7 @@
 import Data.Maybe
 
 type TypeDecls = [(String, IType)]
-data TypeInfo = TypeInfo {iTypeDecls::TypeDecls, iInfo::Info, iCurThis::SClafer, iCurPath::Maybe IType}
+data TypeInfo = TypeInfo {iTypeDecls::TypeDecls, iUIDIClaferMap::UIDIClaferMap, iCurThis::IClafer, iCurPath::Maybe IType}
 
 newtype TypeAnalysis a = TypeAnalysis (ReaderT TypeInfo (Either ClaferSErr) a)
   deriving (MonadError ClaferSErr, Monad, Functor, MonadReader TypeInfo, Applicative)
@@ -48,10 +47,10 @@
 typeOfUid :: MonadTypeAnalysis m => String -> m IType
 typeOfUid uid = (fromMaybe (TClafer [uid]) . lookup uid) <$> typeDecls
 
-class MonadAnalysis m => MonadTypeAnalysis m where
+class (Functor m, Monad m) => MonadTypeAnalysis m where
   -- What "this" refers to
-  curThis :: m SClafer
-  localCurThis :: SClafer -> m a -> m a
+  curThis :: m IClafer
+  localCurThis :: IClafer -> m a -> m a
 
   -- The next path is a child of curPath (or Nothing)
   curPath :: m (Maybe IType)
@@ -96,17 +95,9 @@
   typeDecls = lift typeDecls
   localDecls = mapErrorT . localDecls
 
-
-instance MonadAnalysis TypeAnalysis where
-  clafers = asks (sclafers . iInfo)
-  withClafers cs r =
-    local setInfo r
-    where
-    setInfo t = t{iInfo = Info cs}
-
 -- | Type inference and checking
 runTypeAnalysis :: TypeAnalysis a -> IModule -> Either ClaferSErr a
-runTypeAnalysis (TypeAnalysis tc) imodule = runReaderT tc $ TypeInfo [] (gatherInfo imodule) undefined Nothing
+runTypeAnalysis (TypeAnalysis tc) imodule = runReaderT tc $ TypeInfo [] (createUidIClaferMap imodule) undefined Nothing
 
 unionType :: IType -> [String]
 unionType TString  = [stringType]
@@ -129,22 +120,67 @@
         []          -> Nothing
         u'          -> return $ TClafer u'
 
-closure :: MonadAnalysis m => [String] -> m [String]
-closure ut = concat <$> mapM hierarchy ut
+claferWithUid :: (Monad m) => UIDIClaferMap -> String -> m IClafer
+claferWithUid uidIClaferMap' u = case findIClafer uidIClaferMap' u of
+  Just c -> return c
+  Nothing -> fail $ "Analysis.claferWithUid: " ++ u ++ " not found!"
 
-intersection :: MonadAnalysis m => IType -> IType -> m (Maybe IType)
-intersection t1 t2 =
-  do
-    h1 <- mapM hierarchy $ unionType t1
-    h2 <- mapM hierarchy $ unionType t2
-    let ut = catMaybes [contains (head u1) u2 `mplus` contains (head u2) u1 | u1 <- h1, u2 <- h2]
-    return $ fromUnionType ut
+parentOf :: (Monad m) => UIDIClaferMap -> UID -> m UID
+parentOf uidIClaferMap' c = case _parentUID <$> findIClafer uidIClaferMap' c of
+  Just u -> return u
+  Nothing -> fail $ "Analysis.parentOf: " ++ c ++ " not found!"
+
+refOf :: (Monad m) => UIDIClaferMap -> UID -> m UID
+refOf uidIClaferMap' c = do
+  case getReference <$> findIClafer uidIClaferMap' c of
+    Just [r] -> return r
+    _        -> fail $ "Analysis.refOf: No ref uid for " ++ show c
+
+hierarchy :: (Monad m) => UIDIClaferMap -> UID -> m [IClafer]
+hierarchy uidIClaferMap' c = (case findIClafer uidIClaferMap' c of
+      Nothing -> fail $ "Analysis.hierarchy: clafer " ++ c ++ "not found!"
+      Just clafer -> return $ findHierarchy getSuper uidIClaferMap' clafer)
+
+hierarchyMap :: (Monad m) => UIDIClaferMap -> (IClafer -> a) -> UID -> m [a]
+hierarchyMap uidIClaferMap' f c = (case findIClafer uidIClaferMap' c of
+      Nothing -> fail $ "Analysis.hierarchyMap: clafer " ++ c ++ "not found!"
+      Just clafer -> return $ mapHierarchy f getSuper uidIClaferMap' clafer)
+
+{-
+ - C is an direct child of B.
+ -
+ -  abstract A
+ -    C      // C - child
+ -  B : A    // B - parent
+ -}
+isIndirectChild :: (Monad m) => UIDIClaferMap -> UID -> UID -> m Bool
+isIndirectChild uidIClaferMap' child parent = do
+  (_:allSupers) <- hierarchy uidIClaferMap' parent
+  childOfSupers <- mapM ((isChild uidIClaferMap' child)._uid) $ allSupers
+  return $ or childOfSupers
+
+isChild :: (Monad m) => UIDIClaferMap -> UID -> UID -> m Bool
+isChild uidIClaferMap' child parent =
+    (case findIClafer uidIClaferMap' child of
+            Nothing -> return False
+            Just childIClafer -> do
+                let directChild = (parent == _parentUID childIClafer)
+                indirectChild <- isIndirectChild uidIClaferMap' child parent
+                return $ directChild || indirectChild
+            )
+
+
+closure :: Monad m => UIDIClaferMap -> [String] -> m [String]
+closure uidIClaferMap' ut = concat `liftM` mapM (hierarchyMap uidIClaferMap' _uid) ut
+
+intersection :: Monad m => UIDIClaferMap -> IType -> IType -> m (Maybe IType)
+intersection uidIClaferMap' t1 t2 = do
+  h1 <- (mapM (hierarchyMap uidIClaferMap' _uid) $ unionType t1)
+  h2 <- (mapM (hierarchyMap uidIClaferMap' _uid) $ unionType t2)
+  return $ fromUnionType $ catMaybes [contains (head u1) u2 `mplus` contains (head u2) u1 | u1 <- h1, u2 <- h2 ]
   where
   contains i is = if i `elem` is then Just i else Nothing
 
-intersects :: MonadAnalysis m => IType -> IType -> m Bool
-intersects t1 t2 = isJust <$> intersection t1 t2
-
 numeric :: IType -> Bool
 numeric TReal    = True
 numeric TInteger = True
@@ -163,8 +199,7 @@
     [t'] -> t'
     ts   -> "[" ++ intercalate "," ts ++ "]"
 
-getIfThenElseType :: MonadAnalysis m => IType -> IType -> m (Maybe IType)
--- the function is similar to 'intersection', but takes into account more ancestors to be able to combine
+-- | This function is similar to 'intersection', but takes into account more ancestors to be able to combine
 -- clafers of different types, but with a common ancestor:
 -- Inputs:
 -- t1 is of type B
@@ -173,12 +208,12 @@
 -- C : A
 -- Outputs:
 -- the resulting type is: A, and the type combination is valid
-getIfThenElseType t1 t2 =
-  do
-    h1 <- mapM hierarchy $ unionType t1
-    h2 <- mapM hierarchy $ unionType t2
-    let ut = catMaybes [commonHierarchy u1 u2 | u1 <- h1, u2 <- h2]
-    return $ fromUnionType ut
+getIfThenElseType :: Monad m => UIDIClaferMap -> IType -> IType -> m (Maybe IType)
+getIfThenElseType uidIClaferMap' t1 t2 = do
+  h1 <- mapM (hierarchyMap uidIClaferMap' _uid) $ unionType t1
+  h2 <- mapM (hierarchyMap uidIClaferMap' _uid) $ unionType t2
+  let ut = catMaybes [commonHierarchy u1 u2 | u1 <- h1, u2 <- h2]
+  return $ fromUnionType ut
   where
   commonHierarchy h1 h2 = filterClafer $ commonHierarchy' (reverse h1) (reverse h2) Nothing
   commonHierarchy' (x:xs) (y:ys) accumulator =
@@ -188,7 +223,7 @@
           then Just x
           else commonHierarchy' xs ys $ Just x
       else accumulator
-  commonHierarchy' _ _ _ = error "Function commonHierarchy' from ResolverType expects two non empty lists but was given at least one empty list!" -- Should never happen
+  commonHierarchy' _ _ _ = error "ResolverType.commonHierarchy' expects two non empty lists but was given at least one empty list!" -- Should never happen
   filterClafer value =
     if (value == Just "clafer") then Nothing else value
 
@@ -203,7 +238,7 @@
 resolveTElement :: String -> IElement -> TypeAnalysis IElement
 resolveTElement _ (IEClafer iclafer) =
   do
-    elements' <- mapM (resolveTElement $ I._uid iclafer) (_elements iclafer)
+    elements' <- mapM (resolveTElement $ _uid iclafer) (_elements iclafer)
     return $ IEClafer iclafer{_elements = elements'}
 resolveTElement parent' (IEConstraint _isHard _pexp) =
   IEConstraint _isHard <$> (testBoolean =<< resolveTConstraint parent' _pexp)
@@ -219,7 +254,8 @@
 resolveTConstraint :: String -> PExp -> TypeAnalysis PExp
 resolveTConstraint curThis' constraint =
   do
-    curThis'' <- claferWithUid curThis'
+    uidIClaferMap' <- asks iUIDIClaferMap
+    curThis'' <- claferWithUid uidIClaferMap' curThis'
     head <$> (localCurThis curThis'' $ (resolveTPExp constraint :: TypeAnalysis [PExp]))
 
 
@@ -233,23 +269,25 @@
       (_,   xs) -> return xs                          -- Case 3: At least one success.
 
 resolveTPExp' :: PExp -> TypeAnalysis [Either ClaferSErr PExp]
-resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident = "ref"}} =
+resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident = "ref"}} = do
+  uidIClaferMap' <- asks iUIDIClaferMap
   runListT $ runErrorT $ do
     curPath' <- curPath
     case curPath' of
       Just curPath'' -> do
-        ut <- closure $ unionType curPath''
-        t <- runListT $ refOf =<< foreachM ut
+        ut <- closure uidIClaferMap' $ unionType curPath''
+        t <- runListT $ refOf uidIClaferMap' =<< foreachM ut
         case fromUnionType t of
           Just t' -> return $ p `withType` t'
           Nothing -> throwError $ SemanticErr _inPos ("Cannot ref from type '" ++ str curPath'' ++ "'")
       Nothing -> throwError $ SemanticErr _inPos ("Cannot ref at the start of a path")
-resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident = "parent"}} =
+resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident = "parent"}} = do
+  uidIClaferMap' <- asks iUIDIClaferMap
   runListT $ runErrorT $ do
     curPath' <- curPath
     case curPath' of
       Just curPath'' -> do
-        parent' <- fromUnionType <$> runListT (parentOf =<< liftList (unionType curPath''))
+        parent' <- fromUnionType <$> runListT (parentOf uidIClaferMap' =<< liftList (unionType curPath''))
         when (isNothing parent') $
           throwError $ SemanticErr _inPos "Cannot parent from root"
         let result = p `withType` fromJust parent'
@@ -258,12 +296,13 @@
           addRef result -- Case 2: Dereference the sident 1..* times
       Nothing -> throwError $ SemanticErr _inPos "Cannot parent at the start of a path"
 resolveTPExp' p@PExp{_exp = IClaferId{_sident = "integer"}} = runListT $ runErrorT $ return $ p `withType` TInteger
-resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident}} =
+resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident}} = do
+  uidIClaferMap' <- asks iUIDIClaferMap
   runListT $ runErrorT $ do
     curPath' <- curPath
-    sident' <- if _sident == "this" then uid <$> curThis else return _sident
+    sident' <- if _sident == "this" then _uid <$> curThis else return _sident
     when (isJust curPath') $ do
-      c <- mapM (isChild sident') $ unionType $ fromJust curPath'
+      c <- mapM (isChild uidIClaferMap' sident') $ unionType $ fromJust curPath'
       unless (or c) $ throwError $ SemanticErr _inPos ("'" ++ sident' ++ "' is not a child of type '" ++ str (fromJust curPath') ++ "'")
     result <- (p `withType`) <$> typeOfUid sident'
     return result -- Case 1: Use the sident
@@ -292,6 +331,7 @@
             | _op == iNot = test (t == TBoolean) >> return TBoolean
             | _op == iCSet = return TInteger
             | _op == iSumSet = test (t == TInteger) >> return TInteger
+            | _op == iProdSet = test (t == TInteger) >> return TInteger
             | _op `elem` [iMin, iGMin, iGMax] = test (numeric t) >> return t
             | otherwise = assert False $ error $ "Unknown op '" ++ _op ++ "'"
       result' <- result
@@ -311,7 +351,8 @@
       arg2s' <- resolveTPExp arg2
       let union' a b = typeOf a +++ typeOf b
       return $ [return (union' arg1' arg2', e{_exps = [arg1', arg2']}) | (arg1', arg2') <- sortBy (comparing $ length . unionType . uncurry union') $ liftM2 (,) arg1s' arg2s']
-  resolveTExp e@IFunExp {_op, _exps = [arg1, arg2]} =
+  resolveTExp e@IFunExp {_op, _exps = [arg1, arg2]} = do
+    uidIClaferMap' <- asks iUIDIClaferMap
     runListT $ runErrorT $ do
       arg1' <- lift $ ListT $ resolveTPExp arg1
       arg2' <- lift $ ListT $ resolveTPExp arg2
@@ -319,7 +360,7 @@
       let t2 = typeOf arg2'
       let testIntersect e1 e2 =
             do
-              it <- intersection e1 e2
+              it <- intersection uidIClaferMap' e1 e2
               case it of
                 Just it' -> return it'
                 Nothing  -> throwError $ SemanticErr _inPos ("Function '" ++ _op ++ "' cannot be performed on '" ++ str t1 ++ "' " ++ _op ++ " '" ++ str t2 ++ "'")
@@ -337,7 +378,7 @@
             | _op == iIntersection = testNotSame arg1' arg2' >> testIntersect t1 t2
             | _op `elem` [iDomain, iRange] = testIntersect t1 t2
             | _op `elem` relSetBinOps = testIntersect t1 t2 >> return TBoolean
-            | _op `elem` [iSub, iMul, iDiv] = test (numeric t1 && numeric t2) >> return (coerce t1 t2)
+            | _op `elem` [iSub, iMul, iDiv, iRem] = test (numeric t1 && numeric t2) >> return (coerce t1 t2)
             | _op == iPlus =
                 (test (t1 == TString && t2 == TString) >> return TString) -- Case 1: String concatenation
                 `catchError`
@@ -346,7 +387,8 @@
       result' <- result
       return (result', e{_exps = [arg1', arg2']})
 
-  resolveTExp e@(IFunExp "ifthenelse" [arg1, arg2, arg3]) =
+  resolveTExp e@(IFunExp "ifthenelse" [arg1, arg2, arg3]) = do
+    uidIClaferMap' <- asks iUIDIClaferMap
     runListT $ runErrorT $ do
       arg1' <- lift $ ListT $ resolveTPExp arg1
       arg2' <- lift $ ListT $ resolveTPExp arg2
@@ -360,10 +402,10 @@
       unless (t1 == TBoolean) $
         throwError $ SemanticErr _inPos ("Function 'if/else' cannot be performed on 'if' " ++ str t1 ++ " 'then' " ++ str t2 ++ " 'else' " ++ str t3)
 
-      it <- getIfThenElseType t2 t3
+      it <- getIfThenElseType uidIClaferMap' t2 t3
       t <- case it of
         Just it' -> return it'
-        Nothing  -> throwError $ SemanticErr _inPos ("Function '=>else' cannot be performed on if '" ++ str t1 ++ "' then '" ++ str t2 ++ "' else '" ++ str t3 ++ "'")
+        Nothing  -> throwError $ SemanticErr _inPos ("Function 'if/else' cannot be performed on if '" ++ str t1 ++ "' then '" ++ str t2 ++ "' else '" ++ str t3 ++ "'")
 
       return (t, e{_exps = [arg1', arg2', arg3']})
 
@@ -407,3 +449,25 @@
   liftCatch catchError e throwError
   where
   liftCatch catchError' m h = ErrorT $ runErrorT m `catchError'` (runErrorT . h)
+
+{-
+ -
+ - Utility functions
+ -
+ -}
+
+liftList :: Monad m => [a] -> ListT m a
+liftList = ListT . return
+
+foreachM :: Monad m => [a] -> ListT m a
+foreachM = ListT . return
+
+comparing :: Ord b => (a -> b) -> a -> a -> Ordering
+comparing f a b = f a `compare` f b
+
+syntaxOf :: PExp -> String
+syntaxOf = printTree . sugarExp
+
+-- Returns true iff the left and right expressions are syntactically identical
+sameAs :: PExp -> PExp -> Bool
+sameAs e1 e2 = syntaxOf e1 == syntaxOf e2 -- Not very efficient but hopefully correct
diff --git a/src/Language/Clafer/Intermediate/ScopeAnalysis.hs b/src/Language/Clafer/Intermediate/ScopeAnalysis.hs
--- a/src/Language/Clafer/Intermediate/ScopeAnalysis.hs
+++ b/src/Language/Clafer/Intermediate/ScopeAnalysis.hs
@@ -23,11 +23,9 @@
 
 import Language.Clafer.ClaferArgs
 import Language.Clafer.Intermediate.Intclafer
-import Language.Clafer.Intermediate.GLPKScopeAnalyzer
 import Language.Clafer.Intermediate.SimpleScopeAnalyzer
 
 -- | Return an appropriate scope analysis for a given strategy
 getScopeStrategy :: ScopeStrategy -> IModule -> [(String, Integer)]
 getScopeStrategy Simple = simpleScopeAnalysis
-getScopeStrategy Full   = glpkScopeAnalysis
-getScopeStrategy _             = const []
+getScopeStrategy _      = const []
diff --git a/src/Language/Clafer/Intermediate/SimpleScopeAnalyzer.hs b/src/Language/Clafer/Intermediate/SimpleScopeAnalyzer.hs
--- a/src/Language/Clafer/Intermediate/SimpleScopeAnalyzer.hs
+++ b/src/Language/Clafer/Intermediate/SimpleScopeAnalyzer.hs
@@ -25,6 +25,7 @@
 import Control.Lens hiding (elements, assign)
 import Data.Graph
 import Data.List
+import Data.Data.Lens (biplate)
 import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.Maybe
@@ -40,9 +41,9 @@
 simpleScopeAnalysis iModule@IModule{_mDecls = decls'} =
     [(a, b) | (a, b) <- finalAnalysis, b /= 1]
     where
-    uidClaferMap = createUidIClaferMap iModule
+    uidClaferMap' = createUidIClaferMap iModule
     findClafer :: UID -> IClafer
-    findClafer uid' = fromJust $ findIClafer uidClaferMap uid'
+    findClafer uid' = fromJust $ findIClafer uidClaferMap' uid'
 
     finalAnalysis = Map.toList $ foldl analyzeComponent supersAndRefsAnalysis connectedComponents
 
@@ -50,12 +51,13 @@
         Map.findWithDefault (error $ "No upper cardinality for clafer named \"" ++ u ++ "\".") u upperCardsMap
     upperCardsMap = Map.fromList [(_uid c, snd $ fromJust $ _card c) | c <- clafers]
 
-    supersAnalysis = foldl (analyzeSupers clafers) Map.empty decls'
-    supersAndRefsAnalysis = foldl (analyzeRefs clafers) supersAnalysis decls'
+    supersAnalysis = foldl (analyzeSupers uidClaferMap' clafers) Map.empty decls'
+    supersAndRefsAnalysis = foldl (analyzeRefs uidClaferMap' clafers) supersAnalysis decls'
     constraintAnalysis = analyzeConstraints constraints upperCards
-    (subclaferMap, parentMap) = analyzeHierarchy clafers
-    connectedComponents = analyzeDependencies clafers
-    clafers = concatMap findClafers decls'
+    (subclaferMap, parentMap) = analyzeHierarchy uidClaferMap' clafers
+    connectedComponents = analyzeDependencies uidClaferMap' clafers
+    clafers :: [ IClafer ]
+    clafers = universeOn biplate iModule
     constraints = concatMap findConstraints decls'
 
     lowerOrUpperFixedCard analysis' clafer =
@@ -65,7 +67,7 @@
         oneForStar = if (cardLb == 0 && cardUb == -1) then 1 else 0
         targetScopeForStar = if ((isJust $ _reference clafer) && cardUb == -1)
             then case getReference clafer of
-                [ref'] -> Map.findWithDefault 1 (fromMaybe "unknown" $ _uid <$> findIClafer uidClaferMap ref' ) analysis'
+                [ref'] -> Map.findWithDefault 1 (fromMaybe "unknown" $ _uid <$> findIClafer uidClaferMap' ref' ) analysis'
                 _      -> 0
             else 0
         lowFromConstraints = Map.findWithDefault 0 (_uid clafer) constraintAnalysis
@@ -100,35 +102,35 @@
         rootScope = 1
         findOrError message m key = Map.findWithDefault (error $ key ++ message) key m
 
-analyzeSupers :: [IClafer] -> Map String Integer -> IElement -> Map String Integer
-analyzeSupers clafers analysis (IEClafer clafer) =
-    foldl (analyzeSupers clafers) analysis' (_elements clafer)
+analyzeSupers :: UIDIClaferMap -> [IClafer] -> Map String Integer -> IElement -> Map String Integer
+analyzeSupers uidClaferMap' clafers analysis (IEClafer clafer) =
+    foldl (analyzeSupers uidClaferMap' clafers) analysis' (_elements clafer)
     where
     (Just (cardLb, cardUb)) = _card clafer
     lowerOrFixedUpperBound = maximum [1, cardLb, cardUb ]
     analysis' = if (isJust $ _reference clafer)
                 then analysis
-                else case (directSuper clafers clafer) of
+                else case (directSuper uidClaferMap' clafer) of
                   (Just c) -> Map.alter (incLB lowerOrFixedUpperBound) (_uid c) analysis
                   Nothing -> analysis
     incLB lb' Nothing = Just lb'
     incLB lb' (Just lb) = Just (lb + lb')
-analyzeSupers _ analysis _ = analysis
+analyzeSupers _ _ analysis _ = analysis
 
-analyzeRefs :: [IClafer] -> Map String Integer -> IElement -> Map String Integer
-analyzeRefs clafers analysis (IEClafer clafer) =
-    foldl (analyzeRefs clafers) analysis' (_elements clafer)
+analyzeRefs :: UIDIClaferMap -> [IClafer] -> Map String Integer -> IElement -> Map String Integer
+analyzeRefs uidClaferMap' clafers analysis (IEClafer clafer) =
+    foldl (analyzeRefs uidClaferMap' clafers) analysis' (_elements clafer)
     where
     (Just (cardLb, cardUb)) = _card clafer
     lowerOrFixedUpperBound = maximum [1, cardLb, cardUb]
     analysis' = if (isJust $ _reference clafer)
-                then case (directSuper clafers clafer) of
+                then case (directSuper uidClaferMap' clafer) of
                     (Just c) -> Map.alter (maxLB lowerOrFixedUpperBound) (_uid c) analysis
                     Nothing -> analysis
                 else analysis
     maxLB lb' Nothing = Just lb'
     maxLB lb' (Just lb) = Just (max lb lb')
-analyzeRefs _ analysis _ = analysis
+analyzeRefs _ _ analysis _ = analysis
 
 analyzeConstraints :: [PExp] -> (String -> Integer) -> Map String Integer
 analyzeConstraints constraints upperCards =
@@ -216,15 +218,15 @@
     dropThisAndParent = dropWhile (== "parent") . dropWhile (== "this")
 
 
-analyzeDependencies :: [IClafer] -> [SCC String]
-analyzeDependencies clafers = connComponents
+analyzeDependencies :: UIDIClaferMap -> [IClafer] -> [SCC String]
+analyzeDependencies uidClaferMap' clafers = connComponents
     where
     connComponents  = stronglyConnComp [(key, key, depends) | (key, depends) <- dependencyGraph]
-    dependencies    = concatMap (dependency clafers) clafers
+    dependencies    = concatMap (dependency uidClaferMap') clafers
     dependencyGraph = Map.toList $ Map.fromListWith (++) [(a, [b]) | (a, b) <- dependencies]
 
-dependency :: [IClafer] -> IClafer -> [(String, String)]
-dependency clafers clafer =
+dependency :: UIDIClaferMap -> IClafer -> [(String, String)]
+dependency uidClaferMap' clafer =
     selfDependency : (maybeToList superDependency ++ childDependencies)
     where
      -- This is to make the "stronglyConnComp" from Data.Graph play nice. Otherwise,
@@ -234,15 +236,15 @@
         | isNothing $ _super clafer = Nothing
         | otherwise =
             do
-                super' <- directSuper clafers clafer
+                super' <- directSuper uidClaferMap' clafer
                 -- Need to analyze clafer before its super
                 return (_uid super', _uid clafer)
     -- Need to analyze clafer before its children
     childDependencies = [(_uid child, _uid clafer) | child <- childClafers clafer]
 
 
-analyzeHierarchy :: [IClafer] -> (Map String [String], Map String String)
-analyzeHierarchy clafers =
+analyzeHierarchy :: UIDIClaferMap -> [IClafer] -> (Map String [String], Map String String)
+analyzeHierarchy uidClaferMap' clafers =
     foldl hierarchy (Map.empty, Map.empty) clafers
     where
     hierarchy (subclaferMap, parentMap) clafer = (subclaferMap', parentMap')
@@ -251,22 +253,16 @@
                 case super' of
                     Just super'' -> Map.insertWith (++) (_uid super'') [_uid clafer] subclaferMap
                     Nothing     -> subclaferMap
-            super' = directSuper clafers clafer
+            super' = directSuper uidClaferMap' clafer
             parentMap' = foldr (flip Map.insert $ _uid clafer) parentMap (map _uid $ childClafers clafer)
 
-directSuper :: [IClafer] -> IClafer -> Maybe IClafer
-directSuper clafers clafer =
-    second $ findHierarchy getSuper clafers clafer
+directSuper :: UIDIClaferMap -> IClafer -> Maybe IClafer
+directSuper uidClaferMap' clafer =
+    second $ findHierarchy getSuper uidClaferMap' clafer
     where
     second [] = Nothing
     second [_] = Nothing
     second (_:x:_) = Just x
-
-
--- Finds all ancestors
-findClafers :: IElement -> [IClafer]
-findClafers (IEClafer clafer) = clafer : concatMap findClafers (_elements clafer)
-findClafers _ = []
 
 
 -- Find all constraints
diff --git a/src/Language/Clafer/Intermediate/Tracing.hs b/src/Language/Clafer/Intermediate/Tracing.hs
--- a/src/Language/Clafer/Intermediate/Tracing.hs
+++ b/src/Language/Clafer/Intermediate/Tracing.hs
@@ -23,7 +23,7 @@
 
 import Data.Map (Map)
 import qualified Data.Map as Map
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Intclafer
 
 traceIrModule :: IModule -> Map Span [Ir] --Map Span [Union (IRClafer IClafer) (IRPExp PExp)]
diff --git a/src/Language/ClaferT.hs b/src/Language/ClaferT.hs
--- a/src/Language/ClaferT.hs
+++ b/src/Language/ClaferT.hs
@@ -29,7 +29,6 @@
   ( ClaferEnv(..)
   , irModuleTrace
   , uidIClaferMap
-  , parentIClaferMap
   , makeEnv
   , getAst
   , getIr
@@ -60,15 +59,11 @@
 import Control.Monad.Error
 import Control.Monad.State
 import Control.Monad.Identity
-import Data.Data.Lens (biplate)
-import Control.Lens ((^..), traversed, universeOn)
 import Data.List
 import qualified Data.Map as Map
-import           Data.StringMap (StringMap)
-import qualified Data.StringMap as SMap
 
 import Language.Clafer.Common
-import Language.Clafer.Front.Absclafer
+import Language.Clafer.Front.AbsClafer
 import Language.Clafer.Intermediate.Tracing
 import Language.Clafer.Intermediate.Intclafer
 import Language.Clafer.ClaferArgs
@@ -121,29 +116,11 @@
 -- | This simulates a field in the ClaferEnv that will always recompute the map,
 --   since the IR always changes and the map becomes obsolete
 --   maps from a UID to an IClafer with the given UID
-uidIClaferMap :: ClaferEnv -> StringMap IClafer
+uidIClaferMap :: ClaferEnv -> UIDIClaferMap
 uidIClaferMap env = createUidIClaferMap $ getIModule $ cIr env
   where
     getIModule (Just (iModule, _, _)) = iModule
     getIModule Nothing                = error "BUG: uidIClaferMap: cannot request IClafer map before desugaring."
-
--- | This simulates a field in the ClaferEnv that will always recompute the map,
---   since the IR always changes and the map becomes obsolete
---   maps to an IClafer which is the parent of the clafer with the given UID
-parentIClaferMap :: ClaferEnv -> StringMap IClafer
-parentIClaferMap env = foldl' (\accumMap' claf -> (addChildren accumMap' claf)) SMap.empty allClafers
-  where
-    getIModule (Just (iModule, _, _)) = iModule
-    getIModule Nothing                = error "BUG: parentIClaferMap: cannot request IClafer map before desugaring."
-
-    allClafers :: [ IClafer ]
-    allClafers = universeOn biplate $ getIModule $ cIr env
-
-    addChildren :: StringMap IClafer -> IClafer     -> StringMap IClafer
-    addChildren    accumMap''               parentClafer =
-      -- insert the parentClafer as a value for the uid of each child
-      foldl' (\accumMap''' uid' -> SMap.insert uid' parentClafer accumMap''') accumMap'' (parentClafer ^.. elements.traversed.iClafer.uid)
-
 
 getAst :: (Monad m) => ClaferT m Module
 getAst = do
diff --git a/test/Suite/Positive.hs b/test/Suite/Positive.hs
--- a/test/Suite/Positive.hs
+++ b/test/Suite/Positive.hs
@@ -71,7 +71,7 @@
 		@? "nonempty card test failed. Files contain empty cardinalities after fully compiling")
 	where
 		getIR (file', (Right (resultMap))) =
-			case Map.lookup Alloy resultMap of
+			case Map.lookup Alloy42 resultMap of
 				Just CompilerResult{claferEnv = ClaferEnv{cIr = Just (iMod, _, _)}} -> [(file', iMod)]
 				_ -> []
 		getIR (_, _) = []
@@ -80,5 +80,5 @@
 
 case_stringEqual :: Assertion
 case_stringEqual = do
-	let strMap = stringMap $ fromJust $ Map.lookup Alloy $ fromRight $ compileOneFragment defaultClaferArgs "A\n    text1 -> string = \"some text\"\n    text2 -> string = \"some text\""
+	let strMap = stringMap $ fromJust $ Map.lookup Alloy42 $ fromRight $ compileOneFragment defaultClaferArgs "A\n    text1 -> string = \"some text\"\n    text2 -> string = \"some text\""
 	(Map.size strMap) == 1 @? "Error: same string assigned to differnet numbers!"
diff --git a/test/Suite/Redefinition.hs b/test/Suite/Redefinition.hs
new file mode 100644
--- /dev/null
+++ b/test/Suite/Redefinition.hs
@@ -0,0 +1,136 @@
+{-# LANGUAGE TemplateHaskell #-}
+{-
+ Copyright (C) 2013 Luke Brown <http://gsd.uwaterloo.ca>
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal in
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ of the Software, and to permit persons to whom the Software is furnished to do
+ so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+-}
+module Suite.Redefinition (tg_Test_Suite_Redefinition) where
+
+import Language.Clafer
+import Language.ClaferT
+import Language.Clafer.Common
+import Language.Clafer.Intermediate.Intclafer
+
+import Functions
+
+import qualified Data.Map as M
+import Data.Maybe (isNothing, isJust, fromJust)
+import Data.StringMap
+import Test.Tasty
+import Test.Tasty.HUnit
+import Test.Tasty.TH
+
+tg_Test_Suite_Redefinition :: TestTree
+tg_Test_Suite_Redefinition = $(testGroupGenerator)
+
+model :: String
+model = unlines
+    [ "abstract Component"
+    , "    abstract InPort ->> Signal"
+    , "    abstract OutPort ->> Signal"
+    , "abstract Signal"
+    , "abstract Command : Signal"
+    , "abstract MotorCommand : Command"
+    , "abstract Request : Signal"
+    , "stop : Request"
+    , "abstract Controller : Component"
+    , "    abstract req : InPort -> Request ?"  -- bag to set and cardinality refinement
+    , "    down : Request"
+    , "WinController : Controller"
+    , "    req : req -> stop"             -- redefinition and cardinality refinement
+    , "    cmd : OutPort -> MotorCommand" -- nested inheritance which requires inheritance hierarchy traversal
+    ]
+
+case_NestedInheritanceMatchTest :: Assertion
+case_NestedInheritanceMatchTest = case compileOneFragment defaultClaferArgs model of
+    Left errors -> assertFailure $ show errors
+    Right compilerResultMap -> case M.lookup Alloy42 compilerResultMap of
+        Nothing -> assertFailure "No Alloy42 result in the result map"
+        Just compilerResult -> let
+                uidIClaferMap' :: StringMap IClafer
+                uidIClaferMap' = uidIClaferMap $ claferEnv compilerResult
+                c0_req = fromJust $ findIClafer uidIClaferMap' "c0_req"
+                c0_req_match = matchNestedInheritance uidIClaferMap' c0_req
+                c1_req = fromJust $ findIClafer uidIClaferMap' "c1_req"
+                c1_req_match = matchNestedInheritance uidIClaferMap' c1_req
+                c0_cmd = fromJust $ findIClafer uidIClaferMap' "c0_cmd"
+                c0_cmd_match = matchNestedInheritance uidIClaferMap' c0_cmd
+                c0_Component = fromJust $ findIClafer uidIClaferMap' "c0_Component"
+                c0_Component_match = matchNestedInheritance uidIClaferMap' c0_Component
+                c0_InPort = fromJust $ findIClafer uidIClaferMap' "c0_InPort"
+                c0_InPort_match = matchNestedInheritance uidIClaferMap' c0_InPort
+                c0_WinController = fromJust $ findIClafer uidIClaferMap' "c0_WinController"
+                c0_WinController_match = matchNestedInheritance uidIClaferMap' c0_WinController
+                c0_down = fromJust $ findIClafer uidIClaferMap' "c0_down"
+                c0_down_match = matchNestedInheritance uidIClaferMap' c0_down
+                {-c0_Alice = fromJust $ findIClafer uidIClaferMap' "c0_Alice"
+                c0_Alice_match = matchNestedInheritance uidIClaferMap' c0_Alice
+                c0_Bob = fromJust $ findIClafer uidIClaferMap' "c0_Bob"
+                c0_Bob_match = matchNestedInheritance uidIClaferMap' c0_Bob-}
+            in do
+                isJust c0_req_match @? ("NestedInheritanceMatch not found for " ++ show c0_req)
+                isProperNesting uidIClaferMap' (c0_req_match) @? ("Improper nesting for " ++ show c0_req)
+                (True, True, True) == isProperRefinement uidIClaferMap' (c0_req_match) @? ("Improper refinement for " ++ show c0_req)
+                (not $ isRedefinition (c0_req_match)) @? ("Improper redefinition for " ++ show c0_req)
+
+                isJust c1_req_match @? ("NestedInheritanceMatch not found for " ++ show c1_req)
+                isProperNesting uidIClaferMap' (c1_req_match) @? ("Improper nesting for " ++ show c1_req)
+                (True, True, True) == isProperRefinement uidIClaferMap' (c1_req_match) @? ("Improper refinement for " ++ show c1_req)
+                isRedefinition (c1_req_match) @? ("Improper redefinition for " ++ show c1_req)
+
+                isJust c0_cmd_match @? ("NestedInheritanceMatch not found for " ++ show c0_cmd)
+                isProperNesting uidIClaferMap' (c0_cmd_match) @? ("Improper nesting for " ++ show c0_cmd)
+                (True, True, True) == isProperRefinement uidIClaferMap' (c0_cmd_match) @? ("Improper refinement for " ++ show c0_cmd)
+                (not $ isRedefinition (c0_cmd_match)) @? ("Improper redefinition for " ++ show c0_cmd)
+
+                isNothing c0_Component_match @? ("Non-existing match found for " ++ show c0_Component)
+                isNothing c0_InPort_match @? ("Non-existing match found for " ++ show c0_InPort)
+
+                isJust c0_WinController_match @? ("NestedInheritanceMatch not found for" ++ show c0_WinController)
+
+                isJust c0_down_match @? ("NestedInheritanceMatch not found for" ++ show c0_down)
+                (isProperNesting uidIClaferMap' (c0_down_match)) @? ("Improper nesting for " ++ show c0_down)
+                (True, True, True) == (isProperRefinement uidIClaferMap' (c0_down_match)) @? ("Improper refinement for " ++ show c0_down)
+                (not $ isRedefinition (c0_down_match)) @? ("Improper redefinition for " ++ show c0_down)
+
+               {- isJust c0_Alice_match @? ("NestedInheritanceMatch not found for " ++ show c0_Alice)
+                isProperNesting uidIClaferMap' (c0_Alice_match) @? ("Improper nesting for " ++ show c0_Alice)
+                (False, False, True) == (isProperRefinement uidIClaferMap' (c0_Alice_match)) @? ("Improper refinement for " ++ show c0_Alice)
+                (not $ isRedefinition (c0_Alice_match)) @? ("Improper redefinition for " ++ show c0_Alice)
+
+                isJust c0_Bob_match @? ("NestedInheritanceMatch not found for " ++ show c0_Bob)
+                isProperNesting uidIClaferMap' (c0_Bob_match) @? ("Improper nesting for " ++ show c0_Bob)
+                (True, True, True) == (isProperRefinement uidIClaferMap' (c0_Bob_match)) @? ("Improper refinement for " ++ show c0_Bob)
+                (not $ isRedefinition (c0_Bob_match)) @? ("Improper redefinition for " ++ show c0_Bob)-}
+
+model2 :: String
+model2 = unlines
+    [ "abstract Person -> Bob 0..2"
+    , "Alice : Person -> Bob 3"    -- Improper cardinality refinement for clafer 'Alice' on line 2 column 1
+    , "Bob : Person ->> Person"    -- Improper bag to set refinement for clafer 'Bob' on line 3 column 1
+    , "Carol : Person -> Person 2" -- Improper target subtyping for clafer 'Carol' on line 4 column 1
+    ]
+
+
+case_NestedInheritanceFailTest :: Assertion
+case_NestedInheritanceFailTest = case compileOneFragment defaultClaferArgs model2 of
+    Left errors -> (show errors) == correctErrMsg @? "Incorrect error message:\nGot:" ++ show errors ++ "\nExpected:\n" ++ correctErrMsg
+    Right _ -> assertFailure "The model not expected to compile."
+    where
+        correctErrMsg = "[SemanticErr {pos = ErrPos {fragId = 1, fragPos = Pos 0 0, modelPos = Pos 0 0}, msg = \"Refinement errors in the following places:\\nImproper cardinality refinement for clafer 'Alice' on line 2 column 1\\nImproper bag to set refinement for clafer 'Bob' on line 3 column 1\\nImproper target subtyping for clafer 'Carol' on line 4 column 1\\n\"}]"
diff --git a/test/Suite/SimpleScopeAnalyser.hs b/test/Suite/SimpleScopeAnalyser.hs
--- a/test/Suite/SimpleScopeAnalyser.hs
+++ b/test/Suite/SimpleScopeAnalyser.hs
@@ -61,8 +61,8 @@
 			, "Hs2 -> H 0..*"
 			, "Hs3 -> H 5..8"
 			, "    l ?"
-			, "abstract F : H"
-			, "f1 : F 2..5"
+			, "abstract FF : H"
+			, "f1 : FF 2..5"
 			, "    m 0"
 			, "i1 -> integer 2..4"
 			, "i2 ->> integer ?"
@@ -96,7 +96,7 @@
 								 , ("c0_Hs2", 16)
 								 , ("c0_Hs3", 8)
 								 , ("c0_l", 8)
-								 , ("c0_F", 5)
+								 , ("c0_FF", 5)
 								 , ("c0_f1", 5)
 								 , ("c0_m", 0)
 								 , ("c0_i1", 4)
@@ -131,7 +131,7 @@
 	let
 		-- use simple scope inference
 		(Right compilerResultMap) = compileOneFragment defaultClaferArgs model
-		(Just compilerResult) = M.lookup Alloy compilerResultMap
+		(Just compilerResult) = M.lookup Alloy42 compilerResultMap
 		computedScopesSet :: M.Map UID Integer
 		computedScopesSet = M.fromList $ scopesList compilerResult
 
@@ -146,7 +146,7 @@
 	let
 		-- use simple scope inference
 		(Right compilerResultMap) = compileOneFragment defaultClaferArgs model
-		(Just compilerResult) = M.lookup Alloy compilerResultMap
+		(Just compilerResult) = M.lookup Alloy42 compilerResultMap
 		Just (iModule, _, _) = cIr $ claferEnv compilerResult
 
 		qNameMaps = deriveQNameMaps iModule
diff --git a/test/test-suite.hs b/test/test-suite.hs
--- a/test/test-suite.hs
+++ b/test/test-suite.hs
@@ -32,6 +32,7 @@
 import Suite.Positive
 import Suite.Negative
 import Suite.SimpleScopeAnalyser
+import Suite.Redefinition
 import Functions
 import Test.Tasty
 import Test.Tasty.HUnit
@@ -41,7 +42,13 @@
 tg_Main_Test_Suite = $(testGroupGenerator)
 
 main :: IO ()
-main = defaultMain $ testGroup "Tests" [tg_Main_Test_Suite, tg_Test_Suite_Positive, tg_Test_Suite_Negative, tg_Test_Suite_SimpleScopeAnalyser]
+main = defaultMain $ testGroup "Tests"
+    [ tg_Test_Suite_Redefinition
+    , tg_Main_Test_Suite
+    , tg_Test_Suite_Positive
+    , tg_Test_Suite_Negative
+    , tg_Test_Suite_SimpleScopeAnalyser
+    ]
 
 {-
 a            // ::a -> c0_a
@@ -66,29 +73,29 @@
 
 case_FQMapLookup :: Assertion
 case_FQMapLookup = do
-	let
-		(Just (iModule, _, _)) = cIr $ claferEnv $ fromJust $ Map.lookup Alloy $ fromRight $ compileOneFragment defaultClaferArgs model
-		qNameMaps = deriveQNameMaps iModule
-	[ "c0_a" ] == getUIDs qNameMaps "::a"  @? "UID for `::a` different from `c0_a`"
-	[ "c0_b" ] == getUIDs qNameMaps "::a::b"  @? "UID for `::a::b` different from `c0_b`"
-	[ "c1_b" ] == getUIDs qNameMaps "::b"  @? "UID for `::b` different from `c1_b`"
-	[ "c0_c" ] == getUIDs qNameMaps "::c"  @? "UID for `::c` different from `c0_c`"
-	[ "c0_d" ] == getUIDs qNameMaps "::c::d"  @? "UID for `::c::d` different from `c0_d`"
-	[ "c0_d" ] == getUIDs qNameMaps "c::d"  @? "UID for `c::d` different from `c0_d`"
-	[ "c2_b" ] == getUIDs qNameMaps "::c::d::b"  @? "UID for `::c::d::b` different from `c2_b`"
-	[ "c1_d" ] == getUIDs qNameMaps "::d"  @? "UID for `::d` different from `c1_d`"
-	[ "c3_b" ] == getUIDs qNameMaps "::d::b"  @? "UID for `::d::b` different from `c3_d`"
-	null ([ "c0_b", "c1_b", "c2_b", "c3_b" ] \\ (getUIDs qNameMaps "b" )) @? "UIDs for `b` different from `c0_b`, `c1_b`, `c2_b`, `c3_b` "
-	null ([ "c2_b", "c3_b" ] \\ (getUIDs qNameMaps "d::b" )) @? "UIDs for `d::b` different from `c2_b`, `c3_b` "
-	null ([ "c0_d", "c1_d" ] \\ (getUIDs qNameMaps "d" )) @? "UIDs for `d` different from `c0_d`, `c1_d` "
-	null (getUIDs qNameMaps "x") @? "UID for `x` different from []"
-	null (getUIDs qNameMaps "::x") @? "UID for `::x` different from []"
+    let
+        (Just (iModule, _, _)) = cIr $ claferEnv $ fromJust $ Map.lookup Alloy42 $ fromRight $ compileOneFragment defaultClaferArgs model
+        qNameMaps = deriveQNameMaps iModule
+    [ "c0_a" ] == getUIDs qNameMaps "::a"  @? "UID for `::a` different from `c0_a`"
+    [ "c0_b" ] == getUIDs qNameMaps "::a::b"  @? "UID for `::a::b` different from `c0_b`"
+    [ "c1_b" ] == getUIDs qNameMaps "::b"  @? "UID for `::b` different from `c1_b`"
+    [ "c0_c" ] == getUIDs qNameMaps "::c"  @? "UID for `::c` different from `c0_c`"
+    [ "c0_d" ] == getUIDs qNameMaps "::c::d"  @? "UID for `::c::d` different from `c0_d`"
+    [ "c0_d" ] == getUIDs qNameMaps "c::d"  @? "UID for `c::d` different from `c0_d`"
+    [ "c2_b" ] == getUIDs qNameMaps "::c::d::b"  @? "UID for `::c::d::b` different from `c2_b`"
+    [ "c1_d" ] == getUIDs qNameMaps "::d"  @? "UID for `::d` different from `c1_d`"
+    [ "c3_b" ] == getUIDs qNameMaps "::d::b"  @? "UID for `::d::b` different from `c3_d`"
+    null ([ "c0_b", "c1_b", "c2_b", "c3_b" ] \\ (getUIDs qNameMaps "b" )) @? "UIDs for `b` different from `c0_b`, `c1_b`, `c2_b`, `c3_b` "
+    null ([ "c2_b", "c3_b" ] \\ (getUIDs qNameMaps "d::b" )) @? "UIDs for `d::b` different from `c2_b`, `c3_b` "
+    null ([ "c0_d", "c1_d" ] \\ (getUIDs qNameMaps "d" )) @? "UIDs for `d` different from `c0_d`, `c1_d` "
+    null (getUIDs qNameMaps "x") @? "UID for `x` different from []"
+    null (getUIDs qNameMaps "::x") @? "UID for `::x` different from []"
 
 case_AllClafersGenerics :: Assertion
 case_AllClafersGenerics = do
-	let
-		(Just (iModule, _, _)) = cIr $ claferEnv $ fromJust $ Map.lookup Alloy $ fromRight $ compileOneFragment defaultClaferArgs model
-		allClafers :: [ IClafer ]
-		allClafers = universeOn biplate iModule
-		allClafersUids = map _uid allClafers
-	allClafersUids == [ "c0_a", "c0_b", "c1_b", "c0_c", "c0_d", "c2_b", "c1_d", "c3_b"] @? "All clafers\n" ++ show allClafersUids
+    let
+        (Just (iModule, _, _)) = cIr $ claferEnv $ fromJust $ Map.lookup Alloy42 $ fromRight $ compileOneFragment defaultClaferArgs model
+        allClafers :: [ IClafer ]
+        allClafers = universeOn biplate iModule
+        allClafersUids = map _uid allClafers
+    allClafersUids == [ "c0_a", "c0_b", "c1_b", "c0_c", "c0_d", "c2_b", "c1_d", "c3_b"] @? "All clafers\n" ++ show allClafersUids
diff --git a/tools/XsdCheck.class b/tools/XsdCheck.class
Binary files a/tools/XsdCheck.class and b/tools/XsdCheck.class differ
diff --git a/tools/XsdCheck.java b/tools/XsdCheck.java
--- a/tools/XsdCheck.java
+++ b/tools/XsdCheck.java
@@ -36,10 +36,10 @@
 
             validator.validate(source);
         } catch (SAXParseException e) {
-            System.out.println("Validation error on line " + e.getLineNumber() + ", column " + e.getColumnNumber());
+            System.out.println("XML Validation error on line " + e.getLineNumber() + ", column " + e.getColumnNumber());
             System.out.println(e.getMessage());
         } catch (SAXException e) {
-            System.out.println("Validation error.");
+            System.out.println("XML Validation error.");
             System.out.println(e.getMessage());
         }
     }
