|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Z3 plugin |
| 4 | +parent: Plugins |
| 5 | +grand_parent: Flamapy as framework |
| 6 | +permalink: /framework/plugins/z3_plugin |
| 7 | +nav_order: 6 |
| 8 | +--- |
| 9 | + |
| 10 | +# Z3 plugin |
| 11 | +{: .no_toc } |
| 12 | + |
| 13 | +The Z3 plugin provides the metamodel classes required to work with feature models that contain typed attributes (Integer, Real, String) and to analyse them using the Z3 SMT solver. |
| 14 | +{: .fs-6 .fw-300 } |
| 15 | + |
| 16 | +## Table of contents |
| 17 | +{: .no_toc .text-delta } |
| 18 | + |
| 19 | +1. TOC |
| 20 | +{:toc} |
| 21 | + |
| 22 | +{: .highlight } |
| 23 | +> Official repository |
| 24 | +> |
| 25 | +> ``` |
| 26 | +> https://www.github.com/flamapy/z3_metamodel |
| 27 | +> ``` |
| 28 | +
|
| 29 | +## Z3 metamodel plugin of flamapy framework |
| 30 | +
|
| 31 | +The `z3_metamodel` plugin integrates the [Z3 SMT solver](https://github.com/Z3Prover/z3) into the {% include flamapy.html %} framework. Unlike the SAT and BDD plugins which operate on Boolean feature models, Z3 supports typed attributes, enabling analysis of feature models with Integer, Real, and String constraints. |
| 32 | +
|
| 33 | +### Features of the Z3 Metamodel Plugin |
| 34 | +
|
| 35 | +1. **SMT Solver Integration** |
| 36 | + - Leverages the Z3 SMT solver for constraint solving beyond Boolean logic. |
| 37 | + - Handles Integer, Real, and String typed attributes alongside Boolean features. |
| 38 | +
|
| 39 | +2. **Metamodel Classes** |
| 40 | + - Provides the `Z3Model` class to represent feature models with typed attributes. |
| 41 | + - Supports transformation from feature models to Z3 constraint systems. |
| 42 | +
|
| 43 | +3. **Operations** |
| 44 | + - Satisfiability checking for models with typed attributes. |
| 45 | + - Configuration enumeration and counting with attribute constraints. |
| 46 | + - Feature and attribute bound computation (min/max ranges per attribute). |
| 47 | + - Attribute optimization (minimise/maximise attribute values over valid configurations). |
| 48 | +
|
| 49 | +4. **Transformations** |
| 50 | + - **Model-to-Model (M2M)**: Transforms feature models into Z3 constraint representations. |
| 51 | +
|
| 52 | +### Installation instructions |
| 53 | +
|
| 54 | +To install the `z3_metamodel` plugin, follow these steps: |
| 55 | +
|
| 56 | +1. **Install Python**: Ensure that Python 3.9 or later is installed on your system. |
| 57 | +
|
| 58 | +2. **Install the Z3 Metamodel Plugin**: |
| 59 | + - Using pip, the Python package manager, you can install the `z3_metamodel` plugin directly from PyPI: |
| 60 | + ```bash |
| 61 | + pip install flamapy-z3 |
| 62 | + ``` |
| 63 | +
|
| 64 | +### Links |
| 65 | +
|
| 66 | +- **PyPI**: [z3_metamodel on PyPI](https://pypi.org/project/flamapy-z3/) |
| 67 | +- **GitHub Repository**: [z3_metamodel on GitHub](https://github.com/flamapy/z3_metamodel) |
| 68 | +
|
| 69 | +
|
| 70 | +## Operations |
| 71 | +
|
| 72 | +Currently, this plugin enables the following operations on feature models with typed attributes: |
| 73 | +
|
| 74 | +<ul> |
| 75 | + {% assign fm_operations = site.operations | where: "flamapy_z3", true %} |
| 76 | + {% for operation in fm_operations %} |
| 77 | + <li><a href="{{ operation.url }}">{{ operation.title }}</a></li> |
| 78 | + {% endfor %} |
| 79 | +</ul> |
| 80 | +
|
| 81 | +
|
| 82 | +## Transformations supported |
| 83 | +
|
| 84 | +### Model to model transformations |
| 85 | +<ul> |
| 86 | + {% assign transformations = site.transformations | where: "metamodel", "flamapy_z3" %} |
| 87 | + {% assign m2m_transformations = transformations | where: "type", "model_to_model" %} |
| 88 | + {% for transformation in m2m_transformations %} |
| 89 | + <li><a href="{{ transformation.url }}">{{ transformation.title }}</a></li> |
| 90 | + {% endfor %} |
| 91 | +</ul> |
0 commit comments