Giter Site home page Giter Site logo

matiasbrizzio / estimate Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 101.84 MB

EstiMate ๐Ÿฆ‰: A fast and accurate modelcounter tool for estimating the number of models for LTL formulas using transfer matrices.

Home Page: https://sites.google.com/site/unrealrepair/

Haskell 12.08% Makefile 0.11% C 22.49% Yacc 0.82% Lex 0.49% TeX 1.09% Python 2.38% Shell 0.63% C++ 24.73% Java 35.20%
model-counting formal-methods ltl linear-temporal-logic automata matrix tlsf satisfiability sat logic

estimate's Introduction

EstiMate ๐Ÿฆ‰

EstiMate is an approximate model counter, designed to estimate the number of models for a given LTL formula. It utilizes a transfer matrix, generated through a series of tree encodings, to provide approximate model counts.

Acknowledgments ๐ŸŒŸ

If you utilize EstiMate for research purposes, we kindly request that you cite the corresponding paper where the technique was introduced and evaluated: Automated Repair of Unrealisable LTL Specifications Guided by Model Counting. Thank you :)

@inproceedings{10.1145/3583131.3590454,
author = {Brizzio, Mat\'{\i}as and Cordy, Maxime and Papadakis, Mike and S\'{a}nchez, C\'{e}sar and Aguirre, Nazareno and Degiovanni, Renzo},
title = {Automated Repair of Unrealisable LTL Specifications Guided by Model Counting},
year = {2023},
isbn = {9798400701191},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3583131.3590454},
doi = {10.1145/3583131.3590454},
booktitle = {Proceedings of the Genetic and Evolutionary Computation Conference},
pages = {1499โ€“1507},
numpages = {9},
keywords = {search-based software engineering, LTL-synthesis, model counting},
location = {Lisbon, Portugal},
series = {GECCO '23}
}

Maintainers ๐Ÿ‘จโ€๐Ÿ’ป

This code is implemented and maintained by Matias Brizzio and Renzo Degiovanni

Transfer Matrix Generation ๐Ÿ”„

The transfer matrix, denoted as Tฯ•, is generated using the following steps:

  1. Generate the Buchi automaton Bฯ• that recognizes the specification ฯ•.
  2. From Bฯ•, generate a Finite State Automaton Aฯ•.
  3. Generate the transfer matrix Tฯ• from Aฯ•.

Understanding the Process ๐Ÿค”

The Buchi automaton Bฯ• recognizes lasso traces satisfying the formula ฯ•. A lasso trace is an infinite trace that loops back to a previous state, forming a cycle. It accepts infinite traces, as its accepting condition requires visiting an accepting state infinitely often in the lasso trace. In contrast, finite automata recognize finite traces, as their accepting condition only requires reaching a final state.

When generating the finite automaton Aฯ• from Bฯ•, the finite traces recognized by Aฯ• become part of the lasso traces recognized by Bฯ•.

The finite automaton Aฯ• is encoded into an N x N transfer matrix Tฯ•, where N represents the number of states in Aฯ•. Each element Tฯ•[i,j] in the matrix denotes the number of transitions from state i to state j.

By using matrix multiplication, the number of traces of length k accepted by Aฯ• can be computed as I x Tฯ•k x F. Here, I is a row vector representing the initial states, Tฯ•k is the matrix resulting from multiplying Tฯ• k times, and F is a column vector representing the final states of Aฯ•.

Linear Temporal Logic (LTL) ๐Ÿ•ฐ๏ธ

The grammar for LTL aims to support Spot-style LTL. For further details on temporal logic, e.g., semantics, see here.

Propositional Logic โœ”๏ธ

  • True: tt, true, 1
  • False: ff, false, 0
  • Atom: [a-zA-Z_][a-zA-Z_0-9]* or quoted "[^"]+"
  • Negation: !, NOT
  • Implication: ->, =>, IMP
  • Bi-implication: <->, <=>, BIIMP
  • Exclusive Disjunction: ^, XOR
  • Conjunction: &&, &, AND
  • Disjunction: ||, |, OR
  • Parenthesis: (, )

Modal Logic ๐Ÿšช

  • Finally: F
  • Globally: G
  • Next: X
  • (Strong) Until: U
  • Weak Until: W
  • (Weak) Release: R
  • Strong Release: M

Precedence Rules ๐Ÿ“œ

To ensure the accurate interpretation of provided LTL formulas, the parser adheres to the following precedence rules:

  • Binary Expressions: These expressions involve two operands and an operator. Examples include conjunction (&&, &, AND), disjunction (||, |, OR), implication (->, =>, IMP), bi-implication (<->, <=>, BIIMP), exclusive disjunction (^, XOR), strong until (U), weak until (W), weak release (R), and strong release (M).

  • Unary Expressions: These expressions involve a single operand and an operator. Examples include negation (!, NOT), next (X), globally (G), and finally (F).

  • Literals, Constants, Parentheses: These are fundamental components of the formula. Literals represent atomic propositions, constants denote truth values (e.g., tt for true, ff for false), and parentheses are used to group subexpressions.

The precedence hierarchy is structured as follows:

OR < AND < Binary Expressions < Unary Expressions < Literals, Constants, Parentheses

This means that binary expressions take precedence over unary expressions, which, in turn, take precedence over literals, constants, and parentheses. For instance, in the expression a && b || c, the conjunction (&&) is evaluated before the disjunction (||), and parentheses can be employed to override this precedence.

Moreover, for chained binary expressions lacking parentheses, the rightmost binary operator holds precedence. For example, a -> b U c is parsed as a -> (b U c).

RUN ESTIMATE ๐Ÿš€

The tool can take as input either a specification in TLSF format or directly an LTL formulae. To run, you have to use the script modelcount.sh.

./modelcount.sh case-studies/arbiter/arbiter.tlsf 

or:

./modelcount.sh -formula="(F (a && p))" -k=10 -vars=a,p [-flags] [-to=timeout]

Flags ๐Ÿšฉ

  • -auto = enables EstiMate
  • -re = uses a Regular expression model counter
  • without flag; uses exact model counter

Contact Us ๐Ÿ“ง

This README is here to give you a complete rundown of EstiMate, covering its features and how to use it effectively. If you have any questions or come across any roadblocks, don't hesitate to get in touch with us.

Thanks for taking an interest in EstiMate! ๐Ÿฆ‰

Happy coding and may your projects soar to new heights! ๐Ÿš€

estimate's People

Contributors

matiasbrizzio avatar

Stargazers

 avatar  avatar

Watchers

 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.