{"id":41958251,"url":"https://github.com/nicdard/fusion-function-generator","last_synced_at":"2026-01-25T22:49:26.980Z","repository":{"id":36969449,"uuid":"472689249","full_name":"nicdard/fusion-function-generator","owner":"nicdard","description":"A generator for Semantic Fusion","archived":false,"fork":false,"pushed_at":"2023-02-15T00:36:12.000Z","size":1347,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-22T22:10:03.089Z","etag":null,"topics":["cvc5","fuzzing","smt","smt-lib","smt-solver","testing","yinyang","z3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicdard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-22T09:10:17.000Z","updated_at":"2022-12-15T00:10:33.000Z","dependencies_parsed_at":"2022-07-13T10:40:33.952Z","dependency_job_id":null,"html_url":"https://github.com/nicdard/fusion-function-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicdard/fusion-function-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicdard%2Ffusion-function-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicdard%2Ffusion-function-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicdard%2Ffusion-function-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicdard%2Ffusion-function-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicdard","download_url":"https://codeload.github.com/nicdard/fusion-function-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicdard%2Ffusion-function-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28760971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cvc5","fuzzing","smt","smt-lib","smt-solver","testing","yinyang","z3"],"created_at":"2026-01-25T22:49:26.133Z","updated_at":"2026-01-25T22:49:26.973Z","avatar_url":"https://github.com/nicdard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fusion-function-generator\n\n![CI](https://github.com/nicdard/fusion-function-generator/actions/workflows/ci.yml/badge.svg)\n\nAutomatic generation of [Fusion Functions](https://yinyang.readthedocs.io/en/latest/fusion.html#fusion-functions) \nused by \n[yinyang](https://yinyang.readthedocs.io/en/latest/index.html) fuzzer for [Semantic Fusion](https://yinyang.readthedocs.io/en/latest/fusion.html).\n\n## CLI\n\n`main.py` is the main entry point to run the tool as a standalone program. Simply type the following command in the shell:\n\n\u003e python3 main.py\n\nThis will run with default parameters. For a complete list of the options please type:\n\n\u003e python3 main.py -h\n\nYou can customize the number fusion functions that are generated and the number of operators that appear in each formula.\nBy default, the functions are saved in `out/fusion_functions.txt`.\n\n## Build the library\nThe project is configured to build the pip package `ffg`.\nWe use wheel, just run:\n\u003e python3 setup.py bdist_wheel\n\nUse the following command to install the package locally (add `-e` to enable hot reloading):\n\u003e python3 -m pip install .\n\n## Setup and using yinyang\n\nHere you can find a complete overview of [yinyang usage](https://yinyang.readthedocs.io/en/latest/fusion.html#usage).\n\nFollow these instructions to set up a basic testing environment.\n\n1. Download the latest version of at least one SMT solver compatible with SMT-LIB format ([Z3](https://github.com/Z3Prover/z3/releases), [CVC5](https://github.com/cvc5/cvc5/releases), ...)\n2. Initialize the yinyang and fusion seed submodules\n3. Run this generator to obtain the **fusion_functions.txt** file\n4. Run yinyang using the generated functions and the pre-categorized seeds\n\nExample command (for sat oracle, quantifier free linear integer algebra, Z3):\n\n```bash\npython3 yinyang/bin/yinyang \"z3\" \\\n  -o sat semantic-fusion-seeds/QF_LIA/sat/ \\\n  -s [path-to-tmp-folder] \\\n  -b [path-to-bugs-folder] \\ # This folder will contain the bugs that are found during yinyang execution \n  -l [path-to-log-folder] \\\n  -c out/fusion_functions.txt \n```\n\n\n## Adding a new theory\n\nThe [generator.py](ffg/gen/generator.py) script is used to generate all the code under [ffg/operators](ffg/operators).\nTo re-generate everything, type:\n\n\u003e python3 ffg/gen/generator.py operators\n\nThis script can be used also to create a stub implementation of a new visitor in [ffg/visitors](ffg/visitors):\n\n\u003e python3 ffg/gen/generator.py stub your-visitor-name-here\n\nTo add a new theory, it is enough to modify the [gen_configuration.py](ffg/gen/gen_configuration.py). \nAdd the new theory description by following the guideline and examples already there.\n\nAfterwards, you will need to re-generate the gen folder and (if needed) update the visitors.\nTo update a visitor, make the visitor inherit from the new visitor class associated with the theory you created,\nand implement all of its methods.\n\n\n## Testing\n\nThe repository provides unit tests using [unittest](https://docs.python.org/3/library/unittest.html) testing framework.\nTo run them, simply type:\n\n\u003e python3 -m unittest discover -v\n\n## Try new features\n\nA [Dockerfile](./Dockerfile) is provided to try out new features of the project with all the dependencies required compiled in debug mode.\n\nThe script [run](scripts/run.sh) can be used to start yinyang with some generated functions in order to find bugs.\nThe script starts also a slack notifier job which sends updates automatically to a slack channel.\nTo this end, environment variables `SLACK_TOKEN` and `SLACK_CHANNEL_ID` should be passed to the container when starting it.\n\n## Benchmarking\n\nThis guide can be used to reproduce the experiments as reported in this [report](./docs/AST_Final_Report.pdf).\n\nA Docker image `ffg` with the latest version of cvc5 and z3 instrumented with gcov is available by building the provided Dockerfile:\n\n\u003e docker build ./benchmarking -t ffg\n\nTo run it, simply type:\n\n\u003e docker run -it --name ffg ffg\n\nThis will create a container named `ffg` in interactive mode. Note that the shell is `bash`.\n\nTo keep data between multiple runs of the container type:\n\n\u003e docker run -it --mount source=ffg-vol,destination=/app/ --name ffg ffg\n\nNote that this will also persist changes in the gcov files used to count the coverage information.\nJust mount the volume in a different directory if you want to have fresh build of z3 and cvc5.\n\nTo open a new bash shell on a container (named `ffg`) running a benchmark:\n\n\u003e docker exec -it ffg /bin/bash\n\nTo get a list of mounted volumes to a running container, type:\n\n\u003e docker inspect -f '{{ .Mounts }}' \\\u003ccontainer-id\\\u003e\n\n## References\n\nSee [docs](docs).\n\n[References.md](docs/References.md) is a list of useful links to documentation or tools.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicdard%2Ffusion-function-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicdard%2Ffusion-function-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicdard%2Ffusion-function-generator/lists"}