{"id":35849417,"url":"https://github.com/whitemech/lydia","last_synced_at":"2026-01-08T07:01:01.532Z","repository":{"id":47751371,"uuid":"248253535","full_name":"whitemech/lydia","owner":"whitemech","description":"A tool for LDLf translation to DFA and for LDLf synthesis.","archived":false,"fork":false,"pushed_at":"2023-05-22T15:56:33.000Z","size":1280,"stargazers_count":15,"open_issues_count":12,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-05-22T17:15:27.397Z","etag":null,"topics":["cpp17","cpp17-library","dfa","ldlf","lydia","synthesis","synthesis-library"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whitemech.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-18T14:26:00.000Z","updated_at":"2023-03-30T15:40:26.000Z","dependencies_parsed_at":"2022-08-23T09:31:12.146Z","dependency_job_id":null,"html_url":"https://github.com/whitemech/lydia","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/whitemech/lydia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Flydia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Flydia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Flydia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Flydia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitemech","download_url":"https://codeload.github.com/whitemech/lydia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitemech%2Flydia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28242439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-08T02:00:06.591Z","response_time":241,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","cpp17-library","dfa","ldlf","lydia","synthesis","synthesis-library"],"created_at":"2026-01-08T07:00:19.236Z","updated_at":"2026-01-08T07:01:01.518Z","avatar_url":"https://github.com/whitemech.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lydia\n\n![](https://img.shields.io/github/v/release/whitemech/lydia?sort=semver)\n![Lydia CI pipeline](https://github.com/whitemech/lydia/workflows/Lydia%20CI%20pipeline/badge.svg)\n![](https://codecov.io/gh/whitemech/lydia/branch/master/graph/badge.svg)\n![](https://img.shields.io/badge/iso-c%2B%2B17-ff69b4)\n[![](https://img.shields.io/badge/build-cmake-lightgrey)](cmake.org/)\n[![](https://img.shields.io/github/license/whitemech/lydia)](./LICENSE)\n\nLydia is a tool for the translation from Linear Temporal Logic on finite traces (LTLf) and \nLinear Dynamic Logic on finite traces (LDLf)  to DFA, and for LTLf/LDLf synthesis.\n\n## Usage\n\nThis is the output of `lydia --help`:\n\n```\nA tool for LTLf/LDLf automata translation and LTLf/LDLf synthesis.\nUsage: lydia [OPTIONS]\n\nOptions:\n  -h,--help                   Print this help message and exit\n  -n,--no-empty               Enforce non-empty semantics.\n  -q,--quiet                  Set quiet mode.\n  -v,--verbose                Set verbose mode.\n  -V,--version                Print the version and exit.\n  -s,--summary                Print the summary.\n  -p,--print                  Print the DFA.\n  -g,--graphviz TEXT:PATH(non-existing)\n                              Output the automaton in Graphviz format.\n  -l,--logic ENUM:value in {ldlf-\u003e0,ltlf-\u003e1} OR {0,1} REQUIRED\n                              Logic.\n  --part TEXT:FILE            Part file.\n  --env Needs: --part         Check env realizability.\n[Option Group: Input format]\n   \n  [Exactly 1 of the following options is required]\n  Options:\n    -i,--inline TEXT Excludes: --file\n                                Formula.\n    -f,--file TEXT:FILE Excludes: --inline\n                                File to formula.\n```\n\nFor example, this command translates the LDLf formula in the file `examples/liveness.ldlf` to a DFA:\n```\nlydia -l ldlf -f examples/liveness.ldlf -g liveness\n```\n\nThe output is in `liveness.svg`.\n\nTo do synthesis of an LTLf formula, you have to provide both the path to the formula\ne.g. `examples/counter_1.ltlf` and a file to the partition file, e.g. `examples/counter_1.part`:\n```\nlydia -l ltlf -f examples/counter_1.ltlf --part examples/counter_1.part\n```\n\n\u003e :warning: We apologize for lack of thorough documentation, e.g. on the grammar accepted by \n\u003e   the tool. We will address this issue as soon as possible. Please\n\u003e   feel free to contact one of the authors for specific help, or \n\u003e   [open an issue](https://github.com/whitemech/lydia/issues/new/choose).\n\n\n## Use the Docker image\n\nThe easiest way to use the software \nis to download the [Docker image](https://hub.docker.com/repository/docker/whitemech/lydia/general) \nwith all the needed dependencies\nand both the library and the tool already built and installed.\n\nTo pull the Docker image `whitemech/lydia:latest`\n```\ndocker pull whitemech/lydia:latest\n```\n\nInstead, to build it from source:\n```shell\n./scripts/docker-build.sh\n```\n\nTo run it, with the current working directory mounted, run:\n```shell\n./scripts/docker-run.sh\n```\n\nor, you can define an alias for `lydia` such that it always run inside a Docker container:\n```\nalias lydia=\"docker run -v$(pwd):/home/default -it whitemech/lydia lydia \"\n```\n\n## Build from source\n\n### Install the dependencies\n\n#### CMake\nWe use CMake as a build tool. Please\ncheck the [official website](https://cmake.org/)\nto download it for your platform.\n\n#### Flex and Bison\nThe project uses Flex and Bison for parsing purposes.\n\nFirse check that you have them: `whereis flex bison`\n\nIf no item occurs, then you have to install them:  \n```sudo apt-get install -f flex bison```\n\n#### CUDD\n\nThe project depends on the CUDD library (version 3.0.0).\n\nTo install the CUDD library, run the following commands:\n\n```shell script\nwget https://github.com/whitemech/cudd/releases/download/v3.0.0/cudd_3.0.0_linux-amd64.tar.gz\ntar -xf cudd_3.0.0_linux-amd64.tar.gz\ncd cudd_3.0.0_linux-amd64\nsudo cp -P lib/* /usr/local/lib/\nsudo cp -Pr include/* /usr/local/include\n```\n\nOtherwise, build from source (customize `PREFIX` variable as you see fit).\n```\ngit clone https://github.com/whitemech/cudd \u0026\u0026 cd cudd\nPREFIX=\"/usr/local\"\n./configure --enable-silent-rules --enable-obj --enable-dddmp --prefix=$PREFIX\nsudo make install\n```\n\nIf you get an error about aclocal, this might be due to either\n1. Not having automake:\n   ```sudo apt-get install automake```\n2. Needing to reconfigure, do this before configuring:\n   ```autoreconf -i```\n3. Using a version of aclocal other than 1.14:\n   modify the version 1.14 in configure accordingly.\n\n#### MONA\n\nThe projects depends on the MONA library, version v1.4 (patch 19).\nWe require that the library is compiled with different values for\nparameters such as `MAX_VARIABLES`, and `BDD_MAX_TOTAL_TABLE_SIZE`\n(you can have a look at the details [here](https://github.com/whitemech/MONA/releases/tag/v1.4-19.dev0)).\n\nTo install the MONA library, run the following commands:\n\n```shell script\nwget https://github.com/whitemech/MONA/releases/download/v1.4-19.dev0/mona_1.4-19.dev0_linux-amd64.tar.gz\ntar -xf mona_1.4-19.dev0_linux-amd64.tar.gz\ncd mona_1.4-19.dev0_linux-amd64\nsudo cp -P lib/* /usr/local/lib/\nsudo cp -Pr include/* /usr/local/include\n```\n\nOtherwise, download the source code and build the library:\n```\ngit clone https://github.com/whitemech/MONA.git \u0026\u0026 cd MONA\n./configure \u0026\u0026 make \u0026\u0026 sudo make install\n# copy headers manually\nsudo mkdir -p /usr/local/include/mona\nsudo cp Mem/mem.h Mem/gnuc.h Mem/dlmalloc.h BDD/bdd_external.h BDD/bdd_dump.h BDD/bdd_internal.h BDD/bdd.h BDD/hash.h DFA/dfa.h GTA/gta.h config.h /usr/local/include/mona\n```\n\n#### Syft+\n\nLydia depends on Syft+ to perform synthesis.\n\nFirst, install the Boost libraries.\n```\nsudo apt-get install libboost-dev\n```\n\nInstall it with:\n```shell script\ngit clone https://github.com/whitemech/Syft.git\ncd Syft\ngit checkout v0.1.1\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\nmake -j\nsudo make install\n```\n\n#### Graphviz\n\nThis tool uses Graphviz to display automata.\nPlease follow the install instructions on the official website:\n\u003chttps://graphviz.gitlab.io/download/\u003e.\n\nOn Ubuntu, this should work:\n```bash\nsudo apt-get install libgraphviz-dev\n```\n\n### Build from source\n\nTo build from source, clone the repository:\n```\ngit clone https://github.com/whitemech/lydia.git --recursive\ncd lydia\n```\n\nThen:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake -j4\n```\n\nAfterwards, to install Lydia in your system:\n```\nsudo make install\n```\nThis will install Lydia under the default path: `/usr/local/bin`. \nTo specify a custom path, use the flag \n`-DCMAKE_INSTALL_PREFIX:PATH=\"\u003ccustom/path\u003e\"`\nat configuration time.\n\n## Tests\n\nFinally, to run the tests:\n```\nmake test\n```\n\nTo configure the build for development, \nuse the flag `-DCMAKE_BUILD_TYPE=Debug`\n\n## Development\n\nIn `scripts/` you can find useful scripts for development. In particular:\n\n- `scripts/apply-clang-format.sh` applies the fixes provided by\n  `clang-format`.\n- `scripts/apply-clang-tidy.sh` applies the fixes provided by\n  `clang-tidy`.\n  \nThe same scripts but with the `check` prefix lets you check whether\nfixes are needed or not.\n\nFor building:\n- `build.sh`: for normal build\n- `build-dev.sh` for development build\n\nFor benchmarking, use `./scripts/benchmark.sh` \n(after `./scripts/build.sh`). \n\n## Notes for macOS users\n\nAlthough we run and test Lydia on a Linux machine, you can build and run\nLydia on macOS systems. However, you may need to apply the following.\n \nFirst, be sure you have the compiler toolchain for macOS installed.\n\nSecond, we recommend installing dependencies via [Homebrew](https://brew.sh/) (e.g. \n`brew install flex`, etc.). Also, notice that although macOS systems natively come with flex and bison pre-installed,\nthose are not up to date versions and won't work with Lydia. \nHence, you have to make sure new versions of `flex` and `bison` executables are in your\nsystem path as:\n```\nexport PATH=\"/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH\"\n``` \nFinally, in order to get the Lydia parser working, you may have to set the \nfollowing environment variable up (e.g. in your `.bashrc`) as follows:\n\n```\nexport CPLUS_INCLUDE_PATH=\"/System/Volumes/Data/usr/local/Cellar/flex/2.6.4_1/include/:$CPLUS_INCLUDE_PATH\"\n```\n\n## License\n\nThis software is released under the GNU Lesser General Public License version 3 or later.\n\n## Acknowledgements\n\nThis work has been partially funded by the [ERC Advanced Grant \"WhiteMech\"](whitemech.github.io/)\nand by the [TAILOR research network](https://tailor-network.eu/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemech%2Flydia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitemech%2Flydia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitemech%2Flydia/lists"}