Skip to main content

LTLf2DFA

LTLf2DFA CI pipeline codecov

LTLf2DFA is a tool that transforms an LTLf or a PLTLf formula into a minimal Deterministic Finite state Automaton (DFA) using MONA.

It is also available online at ltlf2dfa.diag.uniroma1.it.

Prerequisites

This tool uses MONA for the generation of the DFA. Hence, you should first install MONA with all its dependencies on your system following the instructions here.

This tool is also based on the following libraries:

They are automatically added while installing LTLf2DFA.

Install

pip install ltlf2dfa
  • or, from source (master branch):
pip install git+https://github.com/whitemech/LTLf2DFA.git
  • or, clone the repository and install:
git clone htts://github.com/whitemech/LTLf2DFA.git
cd ltlf2dfa
pip install .

How To Use

  • Parse an LTLf formula:
from ltlf2dfa.parser.ltlf import LTLfParser

parser = LTLfParser()
formula_str = "G(a -> X b)"
formula = parser(formula_str)       # returns an LTLfFormula

print(formula)                      # prints "G(a -> X (b))"
  • Or, parse a PLTLf formula:
from ltlf2dfa.parser.pltlf import PLTLfParser

parser = PLTLfParser()
formula_str = "H(a -> Y b)"
formula = parser(formula_str)       # returns a PLTLfFormula

print(formula)                      # prints "H(a -> Y (b))"
  • Translate a formula to the corresponding DFA automaton:
dfa = formula.to_dfa()
print(dfa)                          # prints the DFA in DOT format

Features

  • Syntax and parsing support for the following formal languages:

    • Propositional Logic;
    • Linear Temporal Logic on Finite Traces;
    • Pure-Past Linear Temporal Logic on Finite Traces.
  • Conversion from LTLf/PLTLf formula to MONA (First-order Logic)

NOTE: LTLf2DFA accepts either LTLf formulas or PLTLf formulas, i.e., formulas that have only past, only future or none operators.

Tests

To run tests: tox

To run only the code tests: tox -e py37

To run only the code style checks: tox -e flake8

Docs

To build the docs: mkdocs build

To view documentation in a browser: mkdocs serve and then go to http://localhost:8000

License

LTLf2DFA is released under the GNU Lesser General Public License v3.0 or later (LGPLv3+).

Copyright 2018-2020 WhiteMech

Author

Francesco Fuggitti

History

0.3.0 (2020-05-20)

  • Refinement of all the grammars. Extensive improvement of the parsing.
  • Introduce interfaces and class hierarchy for the logic modules.
  • Several bug fixes and introduce testing.
  • Introduce of docs.
  • Introduce Continuous Integration.
  • Refactor translation feature.
  • Replace parsing library PLY with Lark.

0.2.2 (2019-09-25)

0.2.0 (2019-09-03)

0.1.3 (2018-07-22)

0.1.0 (2018-07-18)

  • First release on PyPI.

Metadata

Release files for ltlf2dfa 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ltlf2dfa 1.0.0
File Size Uploaded Provenance Actions
ltlf2dfa-1.0.0.tar.gz 26.8 kB Without provenance Details for ltlf2dfa-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ltlf2dfa 1.0.0
File Interpreter ABI Platform Actions
ltlf2dfa-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for ltlf2dfa-1.0.0-py2.py3-none-any.whl

Total release size: 50.1 kB

Release files / ltlf2dfa-1.0.0.tar.gz

Download URL ltlf2dfa-1.0.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4d023e6812820afead730d5024c303820c1391b128e33121266d3e52278f06fe
BLAKE2b-256 checksum
How to use checksums
acc2b991bb0614e22aeb5f0a5342f4a3ae4830adae68b6ef76099a4775de0c3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

Release files / ltlf2dfa-1.0.0-py2.py3-none-any.whl

Download URL ltlf2dfa-1.0.0-py2.py3-none-any.whl
Size 23.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d3737da57def1e3abe11aeefe4d277b9582236cae2c4cfb485fd664b1ac89011
BLAKE2b-256 checksum
How to use checksums
b71c8dd969b42c44e26ecc966f9a7f8feadc0ee2571a64d5f6f000f371219403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

Security for ltlf2dfa 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page