packages feed

clafer 0.3.5 → 0.3.5.1

raw patch · 3 files changed

+121/−71 lines, 3 filesdep ~claferPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: clafer

API changes (from Hackage documentation)

- Paths_clafer: getBinDir :: IO FilePath
- Paths_clafer: getDataDir :: IO FilePath
- Paths_clafer: getDataFileName :: FilePath -> IO FilePath
- Paths_clafer: getLibDir :: IO FilePath
- Paths_clafer: getLibexecDir :: IO FilePath
- Paths_clafer: getSysconfDir :: IO FilePath
- Paths_clafer: version :: Version

Files

README.md view
@@ -1,9 +1,11 @@ Clafer
 ======
 
-v0.3.5.20-01-2014
+v0.3.5.1
 
-[Clafer](http://clafer.org) is a general-purpose lightweight structural modeling language developed at [GSD Lab](http://gsd.uwaterloo.ca/), [University of Waterloo](http://uwaterloo.ca). 
+[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. 
 
@@ -22,7 +24,7 @@ ===============
 
 Clafer compiler provides a reference language implementation. 
-It translates models in Clafer to other formats (e.g. Alloy, XML, HTML, DOT) to allow for reasoning and processing with existing tools.
+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)), 
@@ -35,37 +37,36 @@ Contributors
 ------------
 
-* [Kacper Bak](http://gsd.uwaterloo.ca/kbak), Ph.D. Candidate. Main developer.
-* [Jimmy Liang](http://gsd.uwaterloo.ca/jliang), MSc. Candidate. Main developer.
-* [Michał Antkiewicz](http://gsd.uwaterloo.ca/mantkiew), Research Engineer. Requirements, development, architecture, testing, technology transfer.
-* [Ed Zulkoski](http://gsd.uwaterloo.ca/ezulkosk), Pd.D. Candidate. Python IR Generator.
+* [Kacper Bak](http://gsd.uwaterloo.ca/kbak), Original developer.
+* [Jimmy Liang](http://gsd.uwaterloo.ca/jliang), Main developer.
+* [Michał Antkiewicz](http://gsd.uwaterloo.ca/mantkiew), Requirements, development, architecture, testing, technology transfer.
+* [Ed Zulkoski](http://gsd.uwaterloo.ca/ezulkosk), Python IR Generator.
 * Luke Michael Brown, co-op student May-Aug 2013. Many improvements.
-* [Rafael Olaechea](http://gsd.uwaterloo.ca/rolaechea), Pd.D. Candidate. Multi-Objective Optimization extensions.
-
-Getting Clafer Tools
---------------------
+* [Rafael Olaechea](http://gsd.uwaterloo.ca/rolaechea), Multi-Objective Optimization extensions.
 
-Binary distributions of the release 0.3.5 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). 
-Clafer Wiki requires Haskell Platform and MinGW to run on Windows. 
+Getting the Clafer Compiler
+---------------------------
 
-In case these binaries do not work on your particular machine configuration, the tools can be built from source code, as described below.
+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
-* [Python](http://www.python.org/download/) v2.7.*
-  * Needed only by ClaferMOO
+  * 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/)
-  * `dot` is needed only in the `html` mode for SVG graph generation
-* [GNU Linear Programming Kit](http://www.gnu.org/software/glpk/) v4.52
-
-### Installation
+  * the program `dot` is needed only in the `html` mode for SVG graph generation
 
-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
-3. copy alloy's jars to the `<target directory>/tools` folder
+### Installation of GLPK
 
 On Linux
 
@@ -77,63 +78,57 @@ On Windows
 
 1. The binary distribution already includes the GNU Linear Programming Kit DLL `glpk_4_52.dll`.
-
-On Mac
+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`
 
-1. install GPLK from [MacPorts](http://www.macports.org/)
+On Mac only
+1. install GPLK 4.52 from [MacPorts](http://www.macports.org/)
   * execute `sudo port install glpk +universal`
 
-Integration with Sublime Text 2
--------------------------------
+### Installation from binaries
 
-See [IDEs/clafer-README.md](IDEs/clafer-README.md)
+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). 
 
-Installation From Hackage
--------------------------
+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
-* GLPK v4.52
 
-Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.5/) and it can be installed using
+Clafer is now available on [Hackage](http://hackage.haskell.org/package/clafer-0.3.5.1/) and it can be installed using
 
-* `cabal update`
-* `cabal install clafer`
-* To automatically download Alloy jars, execute `make` in `clafer-0.3.5/tools` inside the Cabal's library folder
+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
 
-You'll still need to install GLPK 4.52 for your operating system as described below.
+On Windows 
 
-Building & Installation From Source Code
-----------------------------------------
+* copy GLPK's dll `glpk-0.4.52.dll` to the `C:\Users\<user>\AppData\Roaming\cabal\bin` folder or any other folder on the system `PATH`
 
-### Additional dependencies for building
+### Installation from the source code
 
-* The dependencies for running
+Dependencies
+
 * [The Haskell Platform](http://hackage.haskell.org/platform/) v2013.2.0.0
 * [Alloy4.1 and/or Alloy4.2](http://alloy.mit.edu/alloy/download.html)
   * downloaded automatically during build
 * [Git](http://git-scm.com/)
 
-On Linux
-* [libglpk-dev](http://www.gnu.org/software/glpk/) v4.52
-  * `sudo apt-get install libglpk-dev` on Ubuntu
-
 On Windows 
 
 * [MinGW+MSYS](http://mingw.org) 
-  * since the Haskell Platform already contains MinGW, you may choose to install MinGW+MSYS to the same location, e.g., `c:\...\Haskell Platform\2013.2.0.0`
+  * since the Haskell Platform already contains MinGW, you may choose to install MinGW+MSYS to the same location, e.g., `c:\...\HaskellPlatform\2013.2.0.0`
   * add the `bin` folders of MinGW (`MinGW\bin`) and MSYS (`MinGW\MSYS\1.0\bin`) to your system path
-  * `wget` will be automatically installed 
-* [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/)
-2. execute `sudo port install glpk +universal`
+  * `unzip` will be automatically installed 
 
-### Important: Branches must correspond
+#### Important: Branches must correspond
 
 All related projects are following the *simultaneous release model*. 
 The branch `master` contains releases, whereas the branch `develop` contains code under development. 
@@ -141,7 +136,7 @@ Releases from branches 'master` are guaranteed to work well together.
 Development versions from branches `develop` should work well together but this might not always be the case.
 
-### Building
+#### Building
 
 1. install the dependencies
 2. open the command line terminal. On Windows, open MinGW.
@@ -162,13 +157,15 @@   * `make glpk="/c/<your WinGLPK instal dir>" to=/c/<target directory>`  
 3. add the `<target directory>` to your system PATH
 
-On Windows only
-
-* copy GLPK's dll `glpk-0.4.52.dll` to the `<target directory>` folder or any other folder on the system path
-
 #### Note: 
 > On Windows, use `/` with the `make` command instead of `\`.
 
+Integration with Sublime Text 2
+-------------------------------
+
+See [IDEs/clafer-README.md](IDEs/clafer-README.md)
+
+
 Usage
 =====
 
@@ -178,7 +175,7 @@ (As printed by `clafer --help`)
 
 ```
-Clafer v0.3.5.20-01-2014
+Clafer v0.3.5.1
 
 clafer [OPTIONS] [FILE]
 
@@ -263,6 +260,12 @@ 
 The dependencies among the command line arguments are described on the [model wiki](http://t3-necsis.cs.uwaterloo.ca:8091/ClaferTools/CommandLineArguments).
 
+Multiple modes can be used at the same time. For example, 
+
+`clafer model.cfr -m alloy -m xml -m html -m graph --self-contained --show-references --no-stats`
+
+The mode `-m alloy` is only a default mode if no other modes are given. When other modes are given, the mode `-m alloy` 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:
 
 ```
@@ -293,7 +296,6 @@ * `//# SUMMARY` - shorthand for `//# GRAPH` and `//# STATS`
 * `//# QUALITY_ATTRIBUTE` - is used by ClaferMooVisualizer and ClaferConfigurator to distinguish quality attributes, which should be filtered out, from other clafers.
 
-
 Need help?
 ==========
 * See [language's website](http://clafer.org) for news, technical reports and more
@@ -302,6 +304,6 @@   * 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 wiki](https://github.com/gsdlab/clafer/wiki)
+* 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).
clafer.cabal view
@@ -1,12 +1,12 @@ Name:               clafer
-Version:            0.3.5
+Version:            0.3.5.1
 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, Chris Walker, Luke Michael Brown
-Maintainer:         mantkiew@gsd.uwaterloo.ca
+Author:             Kacper Bąk, Jimmy Liang, Michał Antkiewicz, Chris Walker, Luke Michael Brown
+Maintainer:         Michał Antkiewicz <mantkiew@gsd.uwaterloo.ca>
 Stability:          Experimental
 Category:           Model
 Build-type:         Simple
@@ -17,6 +17,7 @@                     IDEs/clafer-README.md,
                     IDEs/sublime-text-2/Packages/User/clafer.sublime-build
                     Makefile,
+                    tools/XsdCheck.java,
                     tools/XsdCheck.class,
                     tools/ecore2clafer.jar,
                     tools/Makefile
@@ -58,7 +59,7 @@                     test-framework-quickcheck2 >= 0.3.0.1,
                     test-framework-th >= 0.2.4,
 
-                    clafer == 0.3.5
+                    clafer == 0.3.5.1
     hs-source-dirs: src
     other-modules: Paths_clafer
 
@@ -137,7 +138,7 @@                      Language.Clafer.Intermediate.Transformer,
                      Language.Clafer.Optimizer.Optimizer,
                      Language.Clafer.SplitJoin
-
+    other-modules: Paths_clafer
 Test-Suite test-suite
     build-tools:    ghc >= 7.6.3
     default-language: 
@@ -173,11 +174,11 @@                     test-framework-quickcheck2 >= 0.3.0.1,
                     test-framework-th >= 0.2.4,
 
-                    clafer == 0.3.5
+                    clafer == 0.3.5.1
 
     ghc-options     -Wall -fno-warn-unused-do-bind -fno-warn-orphans
 
-    other-modules:
+    other-modules:  Paths_clafer,
                     Functions,
                     Suite.Example,
                     Suite.Positive,
+ tools/XsdCheck.java view
@@ -0,0 +1,47 @@+import java.io.File;
+import java.io.IOException;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Reads in a XSD schema and a XML file and validates the document
+ * against the schema.
+ *
+ * @author Jimmy Liang
+ */
+public class XsdCheck {
+
+    public static void main(String[] args) throws IOException {
+        if (args.length < 2) {
+            System.out.println("Requires two arguments: <xsd-file> <xml-file>");
+            System.exit(1);
+        }
+
+        File xsd = new File(args[0]);
+        File xml = new File(args[1]);
+
+        SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
+
+        try {
+            Schema schema = factory.newSchema(xsd);
+
+            Validator validator = schema.newValidator();
+
+            Source source = new StreamSource(xml);
+
+            validator.validate(source);
+        } catch (SAXParseException e) {
+            System.out.println("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(e.getMessage());
+        }
+    }
+}
+