<commit_before>Clafer
======

v0.3.5.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/).
Clafer can be used for modeling of static hierarchical structures but has no support for modeling the change of the structures over time (behavior). 
The main goal of Clafer is to make modeling more accessible to a wider range of users and domains. 

There are many possible applications of Clafer; however, three are prominent:

1. *Product-Line Modeling* - aims at representing and managing commonality and variability of assets in product lines and creating and verifying product configurations. 
Clafer naturally supports multi-staged configuration. 

2. *Multi-Objective Product Optimization* - aims at finding a set of products in a given product line that are optimal with respect to a set of objectives. 
Clafer multi-objective optimizer generates a Pareto front of optimal product configurations.

3. *Domain Modeling* - aims at improving the understanding of the problem domain in the early stages of software development and determining the requirements with fewer defects. 
This is also known as *Concept Modeling* or *Ontology Modeling*.

Clafer Compiler
===============

Clafer compiler provides a reference language implementation. 
It translates models in Clafer to other formats (e.g. Alloy, XML, Python, JS, HTML, DOT) to allow for reasoning and processing with existing tools (Alloy Analyzer, Choco3, and Z3 SMT solver).

Currently, the compiler is used by 
Clafer Instance Generator ([ClaferIG](https://github.com/gsdlab/claferIG)), 
Clafer Integrated Development Environment ([ClaferIDE](https://github.com/gsdlab/claferIDE)),
Clafer Configurator ([ClaferConfigurator](https://github.com/gsdlab/ClaferConfigurator)), 
Clafer Multi-Objective Optimizer ([ClaferMOO](https://github.com/gsdlab/ClaferMooStandalone)) and 
[Visualizer](https://github.com/gsdlab/ClaferMooVisualizer), and 
Clafer Wiki ([ClaferWiki](https://github.com/gsdlab/claferwiki)).

Contributors
------------

* [<NAME>](http://gsd.uwaterloo.ca/kbak), Original developer.
* [<NAME>](http://gsd.uwaterloo.ca/jliang), Main developer.
* [<NAME>](http://gsd.uwaterloo.ca/mantkiew), Requirements, development, architecture, testing, technology transfer.
* [<NAME>](http://gsd.uwaterloo.ca/ezulkosk), Python IR Generator.
* <NAME>, co-op student May-Aug 2013. Many improvements.
* [<NAME>](http://gsd.uwaterloo.ca/rolaechea), Multi-Objective Optimization extensions.

Getting the Clafer Compiler
---------------------------

Clafer can be installed from a binary distribution (preferred), from Hackage, and from the source code.

### Dependencies for running

Regardless of the installation method, the following are 

Required:

* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) v4.52

Optional:

* [Java Platform (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) v6+, 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.52
  * 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_52.dll`.
2. Install [WinGLPK](http://winglpk.sourceforge.net/) v4.52
  * inside the `w32` folder, copy `glpk_4_52.dll` to `glpk.dll` so that it can be found when building Haskell package `glpk-hs`
  * from `w32` folder, copy `glpk_4_52.dll` to `<user>\AppData\Roaming\cabal\bin`

On Mac only
1. install GPLK 4.52 from [MacPorts](http://www.macports.org/)
  * execute `sudo port install glpk +universal`

### Installation from binaries

Binary distributions of the release 0.3.5.1 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). 

1. download the binaries and unpack `<target directory>` of your choice
2. add the `<target directory>` to your system path so that the executables can be found

### Installation from Hackage

Dependencies

* [The Haskell Platform](http://hackage.haskell.org/platform/) v2013.2.0.0

Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.5.1/) and it can be installed using

1. `cabal update`
2. `cabal install clafer`
3. to automatically download Alloy jars
  * execute `make` in `clafer-0.3.5.1/tools` inside the Cabal's library folder<commit_msg>clarified README<commit_after>Clafer
======

v0.3.5.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/).
Clafer can be used for modeling of static hierarchical structures but has no support for modeling the change of the structures over time (behavior). 
The main goal of Clafer is to make modeling more accessible to a wider range of users and domains. 

There are many possible applications of Clafer; however, three are prominent:

1. *Product-Line Modeling* - aims at representing and managing commonality and variability of assets in product lines and creating and verifying product configurations. 
Clafer naturally supports multi-staged configuration. 

2. *Multi-Objective Product Optimization* - aims at finding a set of products in a given product line that are optimal with respect to a set of objectives. 
Clafer multi-objective optimizer generates a Pareto front of optimal product configurations.

3. *Domain Modeling* - aims at improving the understanding of the problem domain in the early stages of software development and determining the requirements with fewer defects. 
This is also known as *Concept Modeling* or *Ontology Modeling*.

Clafer Compiler
===============

Clafer compiler provides a reference language implementation. 
It translates models in Clafer to other formats (e.g. Alloy, XML, Python, JS, HTML, DOT) to allow for reasoning and processing with existing tools (Alloy Analyzer, Choco3, and Z3 SMT solver).

Currently, the compiler is used by 
Clafer Instance Generator ([ClaferIG](https://github.com/gsdlab/claferIG)), 
Clafer Integrated Development Environment ([ClaferIDE](https://github.com/gsdlab/claferIDE)),
Clafer Configurator ([ClaferConfigurator](https://github.com/gsdlab/ClaferConfigurator)), 
Clafer Multi-Objective Optimizer ([ClaferMOO](https://github.com/gsdlab/ClaferMooStandalone)) and 
[Visualizer](https://github.com/gsdlab/ClaferMooVisualizer), and 
Clafer Wiki ([ClaferWiki](https://github.com/gsdlab/claferwiki)).

Contributors
------------

* [<NAME>](http://gsd.uwaterloo.ca/kbak), Original developer.
* [<NAME>](http://gsd.uwaterloo.ca/jliang), Main developer.
* [<NAME>](http://gsd.uwaterloo.ca/mantkiew), Requirements, development, architecture, testing, technology transfer.
* [<NAME>](http://gsd.uwaterloo.ca/ezulkosk), Python IR Generator.
* <NAME>, co-op student May-Aug 2013. Many improvements.
* [<NAME>](http://gsd.uwaterloo.ca/rolaechea), Multi-Objective Optimization extensions.

Getting the Clafer Compiler
---------------------------

Clafer can be installed from a binary distribution (preferred), from Hackage, and from the source code.

### Dependencies for running

Regardless of the installation method, the following are 

Required:

* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) v4.52

Optional:

* [Java Platform (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) v6+, 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.52
  * 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_52.dll`.
2. Install [WinGLPK](http://winglpk.sourceforge.net/) v4.52
  * inside the `w32` folder, copy `glpk_4_52.dll` to `glpk.dll` so that it can be found when building Haskell package `glpk-hs`
  * from `w32` folder, copy `glpk_4_52.dll` to `<user>\AppData\Roaming\cabal\bin`

On Mac only
1. install GPLK 4.52 from [MacPorts](http://www.macports.org/)
  * execute `sudo port install glpk +universal`

### Installation from binaries

Binary distributions of the release 0.3.5.1 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). 

1. download the binaries and unpack `<target directory>` of your choice
2. add the `<target directory>` to your system path so that the executables can be found

### Installation from Hackage

Dependencies

* [The Haskell Platform](http://hackage.haskell.org/platform/) v2013.2.0.0

Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.5.1/) 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\i386-windows-ghc-7.6.3\clafer-0.3.5.1` on Windows or `.cabal/share/x86_64-linux-ghc-7.6.3/clafer-0.3.5.1/` on Linux)
4. to automatically download Alloy jars
  * execute `make` in `tools` 
{'fraction_non_alphanumeric': 0.121758848466923, 'fraction_numerical': 0.016365966676525682, 'mean_word_length': 4.474365893146249, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 12, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 11, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2692416', 'n_tokens_mistral': 3386, 'n_tokens_neox': 3086, 'n_words': 1065}