Giter Site home page Giter Site logo

deryeger / minicheck Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 544 KB

MiniCheck is a CLI for CTL and bounded LTL model checking on transition systems.

License: MIT License

Haskell 98.50% Shell 1.50%
cli ctl-formulas haskell haskell-application ltl-formulas model-checking transition-systems tu-wien

minicheck's Introduction

MiniCheck

MiniCheck is a CLI for CTL and bounded LTL model checking on transition systems.

Syntax

All labels, i.e., atomic propositions, as well as state names can only consist of letters without numbers and whitespace. This does not limit they're expressiveness, as a simple transformation of label names does not affect their boolean values. E.g., nsoda === 0 is equivalent to numberOfSodaIsZero, as both propositions only represent a boolean value.

All formulas require brackets as described in the sections below. This approach was chosen to avoid ambiguity regarding operator precedence.

Transition Systems

The syntax of transition systems is displayed in the example file examples/vending-machine.txt.

The arrow indicates initial states, while dashes indicate regular states. Each state is automatically labelled by itself, i.e., its name. Further labels, i.e., atomic propositions, can be specified by appending them to the state name, separated by a colon (see examples/labels.txt).

Validations

A transition system must have at least one initial state. The transitions may only specify defined states. All states must have an outgoing transition.

CTL Formulas

State formulas:

  • true == true
  • a == a
  • ¬Φ == !(Φ)
  • Φ_1 ∧ Φ_2 == (Φ_1 && Φ_2)
  • Φ_1 ∨ Φ_2 == (Φ_1 || Φ_2)
  • Φ_1 → Φ_2 == (Φ_1 -> Φ_2)
  • Φ_1 ↔ Φ_2 == (Φ_1 <-> Φ_2)
  • Φ_1 ⊕ Φ_2 == (Φ_1 xor Φ_2)
  • ∃φ == E φ
  • ∀φ == A φ

Path formulas:

  • Φ_1 Until Φ_2 == (Φ_1 U Φ_2)
  • Next Φ == (X Φ)
  • Eventually Φ == (F Φ)
  • Always Φ == (G Φ)

Validations

All atomic propositions used in a formula must be defined in the transition system.

LTL Formulas

  • true == true
  • a == a
  • ¬Φ == !(Φ)
  • Φ_1 ∧ Φ_2 == (Φ_1 && Φ_2)
  • Φ_1 ∨ Φ_2 == (Φ_1 || Φ_2)
  • Φ_1 → Φ_2 == (Φ_1 -> Φ_2)
  • Φ_1 ↔ Φ_2 == (Φ_1 <-> Φ_2)
  • Φ_1 ⊕ Φ_2 == (Φ_1 xor Φ_2)
  • Φ_1 Until Φ_2 == (Φ_1 U Φ_2)
  • Next Φ == (X Φ)
  • Eventually Φ == (F Φ)
  • Always Φ == (G Φ)

Validations

All atomic propositions used in a formula must be defined in the transition system.

Development

Run cabal update to install dependencies and cabal run MiniCheck -- to start the application.

Reference the usage section on CLI arguments. Note that they must follow the -- separator.

Requirements

The following tools must be installed and activated, preferably via GHCup (v0.1.19.2).

  • cabal v3.10.1.0
  • GHC v9.2.5
  • HLS 1.9.1.0

Structure

The project is dvided into the following directories:

  • app: The CLI application.
  • lib: The business logic for parsing, validating, and evaluating CTL/LTL formulas and transition systems.
  • test: Unit tests for the business logic.

Tests

The test suite can be run using cabal test or cabal test --enable-coverage. It covers the parser and semantics for CTL and LTL formulas as well as transition systems.

Installation

The same requirements as those described in the development section apply.

Run cabal install --overwrite-policy=always to install the CLI application.

The run-examples.sh script will install the CLI locally and run a few test commands to verify the installation.

Usage

The CLI application can be invoked with the MiniCheck command. Pass --help for help text.

Three modes are available:

  • minicheck validate TS_FILE: Parse and validate the transition system found at TS_FILE.
  • minicheck ctl TS_FILE CTL_FORMULA: Evaluate the CTL formula in the transition system found at TS_FILE.
  • minicheck ltl TS_FILE LTL_FORMULA BOUND: Evaluate the LTL formula in the transition system found at TS_FILE with BOUND as the maximum path length.

minicheck's People

Contributors

deryeger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.