clafer 0.4.2 → 0.4.2.1
raw patch · 5 files changed
+102/−71 lines, 5 filesdep ~clafer
Dependency ranges changed: clafer
Files
- CHANGES.md +30/−26
- README.md +63/−36
- clafer.cabal +3/−3
- src/Language/Clafer/Intermediate/ResolverInheritance.hs +5/−5
- stack.yaml +1/−1
CHANGES.md view
@@ -1,54 +1,58 @@-# Clafer Version 0.4.2 released on Oct 16, 2015 +Clafer Version 0.4.2.1 released on Oct 19, 2015 -[Release](https://github.com/gsdlab/clafer/pull/74) +* Fixed Haddock build, updated README, fixed a test case. -# Clafer Version 0.4.1 released on Sep 1, 2015 +Clafer Version 0.4.2 released on Oct 16, 2015 -[Release](https://github.com/gsdlab/clafer/pull/71) +* [Release](https://github.com/gsdlab/clafer/pull/74) -# Clafer Version 0.4.0 released on Jul 28, 2015 +Clafer Version 0.4.1 released on Sep 1, 2015 -[Release](https://github.com/gsdlab/clafer/pull/68) +* [Release](https://github.com/gsdlab/clafer/pull/71) -# Clafer Version 0.3.10 released on April 24, 2015 +Clafer Version 0.4.0 released on Jul 28, 2015 -[Release](https://github.com/gsdlab/clafer/pull/66) +* [Release](https://github.com/gsdlab/clafer/pull/68) -# Clafer Version 0.3.9 released on March 06, 2015 +Clafer Version 0.3.10 released on April 24, 2015 -[Release](https://github.com/gsdlab/clafer/pull/63) +* [Release](https://github.com/gsdlab/clafer/pull/66) -# Clafer Version 0.3.8 released on January 27, 2015 +Clafer Version 0.3.9 released on March 06, 2015 -[Release](https://github.com/gsdlab/clafer/pull/60) +* [Release](https://github.com/gsdlab/clafer/pull/63) -# Clafer Version 0.3.7 released on October 23, 2014 +Clafer Version 0.3.8 released on January 27, 2015 -[Release](https://github.com/gsdlab/clafer/pull/53) +* [Release](https://github.com/gsdlab/clafer/pull/60) -# Clafer Version 0.3.6.1 released on July 08, 2014 +Clafer Version 0.3.7 released on October 23, 2014 -[Release](https://github.com/gsdlab/clafer/pull/50) +* [Release](https://github.com/gsdlab/clafer/pull/53) -# Clafer Version 0.3.6 released on May 23, 2014 +Clafer Version 0.3.6.1 released on July 08, 2014 -[Release](https://github.com/gsdlab/clafer/pull/48) +* [Release](https://github.com/gsdlab/clafer/pull/50) -# Clafer Version 0.3.5 released on January 20, 2014 +Clafer Version 0.3.6 released on May 23, 2014 -[Release](https://github.com/gsdlab/clafer/pull/44) +* [Release](https://github.com/gsdlab/clafer/pull/48) -# Clafer Version 0.3.4 released on September 20, 2013 +Clafer Version 0.3.5 released on January 20, 2014 -# Clafer Version 0.3.3 released on August 14, 2013 +* [Release](https://github.com/gsdlab/clafer/pull/44) -[Release](https://github.com/gsdlab/clafer/pull/35) +Clafer Version 0.3.4 released on September 20, 2013 -# Clafer Version 0.3.2 released on April 11, 2013 +Clafer Version 0.3.3 released on August 14, 2013 -# Clafer Version 0.3.1 released on October 17, 2012 +* [Release](https://github.com/gsdlab/clafer/pull/35) -# Clafer Version 0.3 released on July 17, 2012 +Clafer Version 0.3.2 released on April 11, 2013 + +Clafer Version 0.3.1 released on October 17, 2012 + +Clafer Version 0.3 released on July 17, 2012 This was the first release of Clafer and included all code since the beginning of the project.
README.md view
@@ -3,8 +3,9 @@ # Clafer, the Language -v0.4.2 +v0.4.2.1 + [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 [MODELS](http://www.itu.dk/research/models/) group at [IT University of Copenhagen](http://www.itu.dk/). @@ -32,7 +33,7 @@ # Clafer, the Compiler Clafer compiler provides a reference implementation of Clafer, the language. -It translates models in Clafer to other formats (e.g., Alloy, JSON, Python, JS, HTML, DOT) to allow for reasoning and processing with existing tools (Alloy Analyzer, Choco3, and Z3 SMT solver, GraphViz). +It translates models in Clafer to other formats (e.g., Alloy, JSON, JS, HTML, DOT) to allow for reasoning and processing with existing tools (Alloy Analyzer, Choco3, and GraphViz). Currently, the compiler is used by @@ -66,15 +67,15 @@ Optional: * [Java Platform (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) v8+, 32bit on Windows, 64bit otherwise - * needed only for running Alloy validation + * only needed for running Alloy validation * [Alloy4.2](http://alloy.mit.edu/alloy/download.html) - * needed only for Alloy output validation + * only needed for Alloy output validation * [GraphViz](http://graphviz.org/) * the program `dot` is needed only in the `html` mode for SVG graph generation ### Installation from binaries -Binary distributions of the release 0.4.2 of Clafer Tools for Windows, Mac, and Linux, +Binary distributions of the release 0.4.2.1 of Clafer Tools for Windows, Mac, and Linux, can be downloaded from [Clafer Tools - Binary Distributions](http://gsd.uwaterloo.ca/clafer-tools-binary-distributions). @@ -83,34 +84,46 @@ ### Installation from Hackage -Dependencies +Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.4.2.1/) and it can be installed using either [`stack`](https://github.com/commercialhaskell/stack) or [`cabal-install`](https://hackage.haskell.org/package/cabal-install). -* [GHC](https://www.haskell.org/downloads) v7.10.* +#### Installation using `stack` -Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.4.2/) and it can be installed using +Stack is the only requirement: no other Haskell tooling needs to be installed because stack will automatically install everything that's needed. -1. `cabal update` -2. `cabal install clafer` -3. on Windows `cd C:\Users\<user>\AppData\Roaming\cabal\i386-windows-ghc-7.10.2\clafer-0.4.2` -4. on Linux `ca ~/.cabal/share/x86_64-linux-ghc-7.10.2/clafer-0.4.2/` -5. to automatically download Alloy jars, execute - * `cd tools` - * `make` +1. [install `stack`](https://github.com/commercialhaskell/stack#how-to-install) +2. execute `stack install clafer` +#### Installation using `cabal-install` + +Dependencies + +* [GHC](https://www.haskell.org/downloads) >= 7.8.3. 7.10.2 is recommended, +* `cabal-install` >= 1.18, should be installed together with a GHC distribution, +* [alex](https://hackage.haskell.org/package/alex), +* [happy](https://hackage.haskell.org/package/happy). + +1. Install GHC +2. `cabal update` +3. `cabal install alex happy` +4. `cabal install clafer` +5. on Windows `cd C:\Users\<user>\AppData\Roaming\cabal\i386-windows-ghc-7.10.2\clafer-0.4.2.1` +6. on Linux `ca ~/.cabal/share/x86_64-linux-ghc-7.10.2/clafer-0.4.2.1/` +7. to automatically download Alloy jars, execute + * `make alloy4.2.jar`, + * move `alloy4.2.jar` to the location of the clafer executable. + ### Installation from the source code Dependencies -* [GHC](https://www.haskell.org/downloads) v7.10.* -* [Alloy4.2](http://alloy.mit.edu/alloy/download.html) - * downloaded automatically during the build +* [`stack`](https://github.com/commercialhaskell/stack#how-to-install) * [Git](http://git-scm.com/) On Windows * [MSYS2](http://msys2.sourceforge.net/) - * download MSYS2 installer - * in MSYS2 console, execute + * it is installed automatically by `stack` + * after building clafer, execute * `pacman -Syu` * `pacman -S make wget unzip diffutils` @@ -124,13 +137,18 @@ #### Building -1. install the dependencies -2. open the command line terminal. On Windows, open MSYS2 terminal. -3. in some `<source directory>` of your choice, execute +1. in some `<source directory>` of your choice, execute * `git clone git://github.com/gsdlab/clafer.git` -4. in `<source directory>/clafer`, execute - * `cabal update` - * `make init` +2. in `<source directory>/clafer`, execute `stack setup`. This will install all dependencies, build tools, and MSYS2 (on Windows). +3. first time only on Windows + * open `MinGW64 Shell` using `C:\Users\<user>\AppData\Local\Programs\stack\i386-windows\msys2-20150512\mingw64_shell.bat` + * update MSYS2 following the [update procedure](http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/): + * `pacman -Sy` + * `pacman --needed -S bash pacman pacman-mirrors msys2-runtime` + * restart shell if the runtime was updated + * `pacman -Su` + * `pacman -S make wget unzip diffutils` +4. `cd <source directory>` * `make` ### Installation @@ -156,7 +174,7 @@ (As printed by `clafer --help`) ``` -Clafer 0.4.2 +Clafer 0.4.2.1 clafer [OPTIONS] [FILE] @@ -190,13 +208,16 @@ ('alloy' mode only). -s --no-stats Don't print statistics. -v --validate Validate outputs of all modes. Uses - 'tools/alloy4.2.jar' for Alloy - models, and Clafer translator for - desugared Clafer models. Use - '--tooldir' to override the default - location of these tools. + '<tooldir>/alloy4.2.jar' for Alloy + models, '<tooldir>/claferchocoig.jar' + for Alloy models, and Clafer + translator for desugared Clafer + models. Use '--tooldir' to override + the default location ('.') of these + tools. --tooldir=DIR Specify the tools directory - ('validate' only). Default: 'tools/'. + ('validate' only). Default: '.' + (current directory). -a --alloy-mapping Generate mapping to Alloy source code ('alloy' mode only). --self-contained Generate a self-contained html @@ -279,6 +300,11 @@ To make a release, we create a pull request from `develop` into `master`. We tag `master` with version numbers after each release merge. +## Building + +We have switched to [Haskell Tool Stack](https://github.com/commercialhaskell/stack#the-haskell-tool-stack). +Install the tool first. + ## Testing We have both automated tests and regression tests. @@ -286,13 +312,14 @@ To run the automated tests (including both unit tests and [doctests](https://github.com/sol/doctest#readme)), execute ``` -cabal test +stack test ``` +To only run unit tests, execute `stack test test-suite`. -To only run unit tests, execute `cabal test test-suite`. +To only run doctests, execute `stack test doctests`. -To only run doctests, execute `cabal test doctests`. +> Note: it is still possible to run `cabal test` as previously; however, the `Makefile` uses `stack` by default. For instructions for adding new modules to the doctest suite, see [cabal integration](https://github.com/sol/doctest#cabal-integration).
clafer.cabal view
@@ -1,5 +1,5 @@ Name: clafer -Version: 0.4.2 +Version: 0.4.2.1 Synopsis: Compiles Clafer models to other formats: Alloy, JavaScript, JSON, 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, JavaScript, JSON) to allow for reasoning with existing tools. Homepage: http://clafer.org @@ -40,7 +40,7 @@ , cmdargs >= 0.10.12 , split >= 0.2.2 - , clafer == 0.4.2 + , clafer == 0.4.2.1 other-modules: Paths_clafer library @@ -140,7 +140,7 @@ , tasty-th >= 0.1.3 , transformers-compat >= 0.3 && < 0.5 , mtl-compat >= 0.2.1 - , clafer == 0.4.2 + , clafer == 0.4.2.1 ghc-options: -Wall
src/Language/Clafer/Intermediate/ResolverInheritance.hs view
@@ -53,7 +53,7 @@ abstractClafers = filter _isAbstract $ bfsClafers $ toClafers unresolvedDecls resolvedDecls <- mapM (resolveNElement abstractClafers) unresolvedDecls let - relocatedDecls = relocateTopLevelAbstractToParents resolvedDecls -- |> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <| + relocatedDecls = relocateTopLevelAbstractToParents resolvedDecls -- F> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <F uidClaferMap' = createUidIClaferMap imodule{_mDecls = relocatedDecls} resolvedHierarchyDecls = map (resolveHierarchy uidClaferMap') relocatedDecls resolvedHierarchiesIModule = imodule{_mDecls = resolvedHierarchyDecls} @@ -67,7 +67,7 @@ resolveNClafer abstractClafers clafer = do (super', superIClafer') <- resolveNSuper abstractClafers $ _super clafer - -- |> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> |> + -- F> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> F> let parentUID' = case superIClafer' of @@ -76,7 +76,7 @@ then _parentUID superIClafer'' -- make clafer a sibling of the superIClafer' else _parentUID clafer Nothing -> _parentUID clafer - -- <| Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <| + -- <F Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <F elements' <- mapM (resolveNElement abstractClafers) $ _elements clafer return $ clafer {_super = super', _parentUID = parentUID', _elements = elements'} @@ -312,7 +312,7 @@ else ("Improperly nested clafer '" ++ i ++ "' on line " ++ show l ++ " column " ++ show c ++ "\n") isImproper _ = "" --- |> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> |> +-- F> Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> F> relocateTopLevelAbstractToParents :: [IElement] -> [IElement] relocateTopLevelAbstractToParents originalElements = let @@ -342,4 +342,4 @@ ++ newChildren in targetElement & iClafer . elements .~ newElements --- <| Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <| +-- <F Top-level abstract clafer extending a nested abstract clafer <https://github.com/gsdlab/clafer/issues/67> <F
stack.yaml view
@@ -1,6 +1,6 @@ # for GHC-7.10.2 extra-deps: [ data-stringmap-1.0.1.1 ] -resolver: lts-3.9 +resolver: lts-3.10 # for GHC-7.8.4 # extra-deps: [ data-stringmap-1.0.1.1, json-builder-0.3 ]