Skip to main content

A tool for generating a DFA from an LTLf formula

Project description

LTLf2DFA

ciaio

LTLf2DFA is a simple tool that processes an LTLf formula (with past or future operators) and generates the corresponding minimized DFA (Deterministic Finite state Automaton) using MONA. This tool is written in Python 3.6.

It is tested on Linux Ubuntu 16.04.

Getting Started

Requirements

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

This tool is also based on the following libraries:

They are automatically added while installing LTLf2DFA.

How To Install It

  • From PyPI:
pip install ltlf2dfa
  • From this repository:
pip install git+https://github.com/Francesco17/LTLf2DFA@distribution#egg=ltlf2dfa

How To Use It:

  • Simply parse an LTLf formula with past or future operators:
from ltlf2dfa.Parser import MyParser

formula = "G(a->Xb)"
parser = MyParser()
parsed_formula = parser(formula)

print(parsed_formula)
  • Translate an LTLf formula to the corresponding DFA automaton:
from ltlf2dfa.Translator import Translator
from ltlf2dfa.DotHandler import DotHandler

formula = "G(a->Xb)"
declare_flag = False

translator = Translator(formula)
translator.formula_parser()
translator.translate()
translator.createMonafile(declare_flag) #it creates automa.mona file
translator.invoke_mona("automa.mona") #it returns an intermediate automa.dot file

dotHandler = DotHandler("inter-automa.dot")
dotHandler.modify_dot()
dotHandler.output_dot() #it returns the final automa.dot file

Syntax

The syntax accepted by LTLf2DFA is the following:

OPERATOR SYMBOL
TRUE T
FALSE F
AND &
OR |
NOT ~
IMPLICATION ->
D-IMPLICATION <->
NEXT X
UNTIL U
EVENTUALLY E
GLOBALLY G
YESTERDAY (*) Y
SINCE (*) S
ONCE (*) O
GLOBALLY (*) H

(*) are PAST operators.

Also parentheses ( and ) can be used.

NOTE: LTLf2DFA accepts ONLY separated formulas, i.e. formulas that have only past, only future or none operators.

Author

Francesco Fuggitti

License

This project is licensed under the MIT License - see the LICENSE file for details

Contacts

If, for any reason, you are interested in feel free to contact me by email.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ltlf2dfa-0.1.2.post2.tar.gz (173.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ltlf2dfa-0.1.2.post2-py3-none-any.whl (173.1 kB view details)

Uploaded Python 3

File details

Details for the file ltlf2dfa-0.1.2.post2.tar.gz.

File metadata

  • Download URL: ltlf2dfa-0.1.2.post2.tar.gz
  • Upload date:
  • Size: 173.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ltlf2dfa-0.1.2.post2.tar.gz
Algorithm Hash digest
SHA256 6aefb3ee93e0973068dd87d69f33e89283b880a9e0823d60a7382be9294255c2
MD5 8d7fffab638c66f6bc01adb3b14b1452
BLAKE2b-256 b9a28a508cb5a752ef9b4c61c58a9ecca02dc511c5727154e2696783282eac4e

See more details on using hashes here.

File details

Details for the file ltlf2dfa-0.1.2.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for ltlf2dfa-0.1.2.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 58f2f4117ef96ded087e75c5bb82642660667789228e10e6f990ecdb0594ef85
MD5 9a68b0580c6996cf91f5275e24a800a4
BLAKE2b-256 7f5401e565bc2ddf0749f306dc6bfcfc33e82494fbc93b09151147dfb3953050

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page