README

Clafer, the language

v0.5.0

Clafer is a general-purpose lightweight structural and behavioral modeling language developed by
GSD Lab, University of Waterloo, and
MODELS group at IT University of Copenhagen.
Clafer can be used for modeling of static hierarchical structures and for modeling the change of the structures over time (behavior). Clafer allows for naturally expressing variability in both the structure and 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:

Product-Line Architecture 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.
By applying modeling patterns, Clafer can be used for feature modeling, architecture modeling (e.g., by applying EAST-ADL), and behavior modeling (e.g., hierarchical state transition systems). All these aspects naturally include variability.

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.

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.

Concept Behavior Modeling - aims at eliciting how a structure of a concept evolved
over time and checking properties of possible behaviors.

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.
When building the tools, the branches should match.
Releases from branches 'masterare guaranteed to work well together.
Development versions from branchesdevelop` should work well together but this might not always be the case.

//# GRAPH - marks the insertion point for a graph rendering. The graph is only produced in HTML mode with the argument --add-graph.

//# STATS - marks the insertion point for module statistics. The statistics can be omitted using the argument --no-stats.

//# SUMMARY - shorthand for //# GRAPH and //# STATS

Developing Clafer

Here is some information about the development of the Clafer compiler.

Branching

We are following the simplified version of the successful Git branching model.
The branch master is for releases and hot fixes only.
The branch develop is for minor development and for integration of features from feature branches.
For any substantial work, branch off from develop and create a pull request back into develop after the work is completed.
We do testing and code review before merging into develop.
If the develop is ahead, merge it into the feature branch and perform integration testing there.
To make a release, we create a pull request from develop into master.
We tag master with version numbers after each release merge.

create a test case Clafer model in either test/positive or test/negative depending on whether a test case should compile successfully or return an error. For example, see a positive test case test/positive/redefinition.cfr.

produce the intended compiler output automatically if possible and manually fix the output. Save the intended output as a regression test case. For example, see test/regression/redefinition.cfr.reg.

implement the feature to reproduce the intended output: compiler the test case and execute

cd test
make diffRegressions

this will show you how the current output diverges from the intended output.

Modifying the grammar

We are using a customized version of BNCF.
Clone the repository and install a binary of bnfc so that it's visible in your PATH.
After changing the grammar, execute

make grammar

Need help?

About
Your go-to Haskell Toolbox.
Our goal is to help you find the software and libraries you need.
Made by developers for developers.
The collection of libraries and resources is based on the
Awesome Haskell List and direct contributions here.
To add a new package, please, check the contribute section.