Examples

We maintain a large collection of different kinds of large and small models on the Clafer Model Wiki.

Here are a few tiny examples:

Feature Model

Feature models express a multitude of products in Software Product Lines (SPLs). They conveniently model commonalities and variability among products.

Clafer model Visualization (CVL notation)
telematicsSystem
    xor channel
        single
        dual

    extraDisplay ?

    xor size
        small
        large

Meta-Model

Meta-models are models of models.

Clafer model Visualization (UML notation)
abstract comp
    version -> integer = 1 + 2

abstract ECU : comp

abstract display : comp
    server -> ECU
    [this.version >= server.version]

Class and Object Diagrams

Class diagrams are structural models composed of classes, attributes, and relationships. Object diagrams represent instances of class diagrams.

Clafer model Visualization (UML notation)
abstract plaECU : ECU
    `display 1..2
        [server = parent]

ECU1 : plaECU

ECU2 : plaECU ?
    master -> ECU1

Constraints

[dual
 extraDisplay
 telematicsSystem.size.large]

More Examples