An open API service indexing awesome lists of open source software.

https://github.com/evdenis/animate

Simple tool to randomly animate Event-B models based on ProB.
https://github.com/evdenis/animate

event-b prob

Last synced: 4 months ago
JSON representation

Simple tool to randomly animate Event-B models based on ProB.

Awesome Lists containing this project

README

          

# Animate

A command-line tool for animating Event-B models using the ProB model checker.

## Features

- Random animation of Event-B models
- Invariant checking during animation
- Coverage analysis
- Trace saving and replay in JSON format
- Model visualization export (machine hierarchy, events, properties, invariants)

## Requirements

- Java 21 or later
- Gradle

## Building

```bash
./gradlew build
```

## Usage

### Basic Animation

```bash
./gradlew run --args="path/to/model.bum"
```

### Options

- `-s, --steps ` - Number of random animation steps (default: 5)
- `-z, --size ` - Default size for ProB sets (default: 4)
- `-i, --invariants` - Check invariants during animation
- `--perf` - Print ProB performance information
- `--save ` - Save animation trace to JSON file
- `--debug` - Enable debug logging

### Commands

#### Replay a Trace

```bash
./gradlew run --args="replay -t path/to/trace.json path/to/model.bum"
```

#### Model Information

```bash
./gradlew run --args="info path/to/model.bum"
```

Export options:
- `-m, --machine ` - Save machine hierarchy graph (.dot or .svg)
- `-e, --events ` - Save events hierarchy graph (.dot or .svg)
- `-p, --properties ` - Save properties graph (.dot or .svg)
- `-i, --invariant ` - Save invariant graph (.dot or .svg)
- `-b, --bmodel ` - Dump prolog model to .eventb file

## CI Integration

Use `animate` in your CI pipelines without building from source.

### GitHub Actions

```yaml
- uses: evdenis/animate@v3
with:
args: 'path/to/model.bum'
```

#### Inputs

| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `args` | Arguments passed to the animate CLI | Yes | — |
| `version` | Release version tag (e.g., `v2.0`) | No | `latest` |
| `java-version` | Java version to use (must be 21 or later) | No | `21` |

#### Examples

```yaml
# Check invariants with 20 steps
- uses: evdenis/animate@v3
with:
args: '--steps 20 --invariants path/to/model.bum'

# Replay a trace
- uses: evdenis/animate@v3
with:
args: 'replay -t tests/trace.json models/system.bum'

# Pin to a specific release
- uses: evdenis/animate@v3
with:
args: 'path/to/model.bum'
version: 'v1.0'
```

### GitLab CI

Include the reusable template and extend the `.animate` hidden job:

```yaml
include:
- remote: 'https://raw.githubusercontent.com/evdenis/animate/v3.0/.gitlab-ci-template.yml'

animate-model:
extends: .animate
variables:
ANIMATE_ARGS: 'path/to/model.bum'
```

#### Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `ANIMATE_ARGS` | Arguments passed to the animate CLI | `''` |
| `ANIMATE_VERSION` | Release version tag (e.g., `v2.0`) | `latest` |

#### Examples

```yaml
include:
- remote: 'https://raw.githubusercontent.com/evdenis/animate/v3.0/.gitlab-ci-template.yml'

# Check invariants with 20 steps
animate-check:
extends: .animate
variables:
ANIMATE_ARGS: '--steps 20 --invariants path/to/model.bum'

# Replay a trace
animate-replay:
extends: .animate
variables:
ANIMATE_ARGS: 'replay -t tests/trace.json models/system.bum'

# Pin to a specific release
animate-pinned:
extends: .animate
variables:
ANIMATE_ARGS: 'path/to/model.bum'
ANIMATE_VERSION: 'v1.0'
```

## License

See LICENSE file for details.