- Learning Clafer
- Domain concept modeling using Clafer
- Guidelines for feature modeling using Clafer
- “Train Station Layout” domain modeling tutorial
- “Traffic Lights” domain modeling tutorial
- Modeling directed graph reachability
- Micro-level and macro-level modeling patterns
- Selected posts and presentations from clafer.org
- Clafer usage scenarios
- ClaferWiki-specific help
- Gitit Wiki general help
This is a public instance of the ClaferWiki to serve as a model repository. We are publishing example models that showcase Clafer as a lightweight structural modeling language. For installation, visit Software.
Each wiki page contains a single Clafer model. The model can be split into model fragments and interwoven with rich-text contents (literate modeling). The model is compiled using the Clafer compiler and rendered as HTML, which provides syntax and error highlighting and hyperlinking, and as a Graph, which provides a different view on the model that emphasizes inheritance and references. Double click on the graph shows/hides references.
Release announcements and changes
| 0.5.0 (current development version: behavioral clafer). See Behavioral Modeling for examples.
Domain concept modeling using Clafer
This tutorial presents basics of Clafer using few examples, introduces Clafer a bit more precisely (but not formally), and finishes with a modeling exercise with two alternative reference solutions.
- Clafer a bit more precisely
- Exercise - Modeling a Concept
- Exercise - Example Reference Solution
- Exercise - Alternative Ways of Modeling
Guidelines for feature modeling using Clafer
“Train Station Layout” domain modeling tutorial
Go to Interactive Tutorial
“Traffic Lights” domain modeling tutorial
Modeling directed graph reachability
Micro-level and macro-level modeling patterns
Some methodological advice on modeling in Clafer from Alexandr Murashkin’s MMath Thesis (University of Waterloo, 2014) “Automotive Electronic/Electric Architecture Modeling, Design Exploration and Optimization using Clafer”.
Selected posts and presentations from clafer.org
- 2015-07-29 Clafer 0.4.0 PowerPoint slide show
- 2015-07-28 Accessing Clafer Models Programmatically
- 2015-06-03 Inheritance of Group Cardinality
- 2015-01-20 Explaining Clafer Semantics by Example
- 2014-01-16 Example-Driven Modeling Using Clafer paper & presentation
Clafer usage scenarios
Clafer can be used in a number of scenarios:
Product-line architecture modeling
Modeling features of products in a product line and their realization as components.
- “Automotive Electronic/Electric Architecture Modeling, Design Exploration and Optimization using Clafer” - using EAST-ADL (Alexandr Murashkin’s MMath Thesis)
- Telematics Product-Line Architecture
- ClaferTools Case Study
Multi-objective optimization of product lines
Modeling features of products in a product line with their quality attributes. Multi-objective optimization discovers which products are optimal given the optimization goals such as “minimize total mass” and “maximize total performance”.
Data center resource allocation problems
Modeling and multi-objectively optimizing resource allocations. Models created by Alexandr Murashkin.
- Allocate services with the given requirements on machines. Maximize the number of free machines.
- Like ISAP but customized to handle time-varied requirements
Feature-based modeling of domain concepts and business rules.
Oracle’s Merchandise Financial Planning domain model
FamiliesToPersons inspired by ATL/Tutorials - Create a simple ATL transformation. We let the reader appreciate the simplicity, conciseness, and declarative nature of this transformation in Clafer.
Ecore metamodels from Juan
- ER 2 RE Metamodel. (ecore source)
- CPFSTool Metamodel. (ecore source)
- OMG Diagram Definition metamodels. (ecore source)
- Declarative Workflow Metamodel. (ecore source)
- RBAC metamodel. (ecore source)
Other cool examples
Clafer is a general-purpose structural modeling language but it’s strengths make it particularly useful in modeling scenarios whereby containment hierarchies and model evolution are very important.
Below are some other examples:
As of version 0.5.0, Clafer can be used for specifying how the structures evolve over time. In this setting, a static Clafer model describes the possible states of the system, whereas, the temporal aspects specify how the states can change.
Here are pages for the different tool demos:
Below is the Clafer-specific markup that can be used in the wiki pages. On the right is the screenshot of the ClaferWiki-Specific Help page which demonstrates the usage of the markup shown on the left.
Add a Clafer code fragment as follows:
Top-level clafers can be placed into separate code fragments but they cannot be split in the middle. That is all children of a top-level clafer must belong to the same code fragment.
or in the full code block notation
Add a graph in the simplified notation:
Double click on the graph in the simplified notation to show/hide references. By default, the graph only shows inheritance relationships allowing for quick inspection of the inheritance hierarchy which is not directly visible in Clafer’s textual notation.
Add a graph in the CVL notation:
Add download links for a complete model file (
Add summary, which includes 1) a graph in the simplified notation, 2) module statistics, and 3) the download links:
Preview button to compile the model and see parsing and compilation errors, if any. At most one error is reported for each code block. If a parsing error is reported, compilation is not executed and therefore no compilation errors are reported.
Save button to commit your edits to the Git repository.
Gitit Wiki general help
For instructions on how to make a link to another wiki page, see the Help page. To create a new wiki page, just create a link to it and follow the link.
Help is always available through the “Help” link in the sidebar. More details on installing and configurating gitit are available in the Gitit User’s Guide.