{"id":37607575,"url":"https://github.com/thiagopbueno/pyddlib","last_synced_at":"2026-01-16T10:13:45.448Z","repository":{"id":62579813,"uuid":"80212665","full_name":"thiagopbueno/pyddlib","owner":"thiagopbueno","description":"pyddlib is a Python3 library for manipulating decision diagrams.","archived":false,"fork":false,"pushed_at":"2017-03-16T15:30:11.000Z","size":272,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-29T05:20:52.652Z","etag":null,"topics":["add","algebraic-data-types","bdd","decision-diagrams","logic","symbolic-manipulation"],"latest_commit_sha":null,"homepage":"https://pythonhosted.org/pyddlib/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagopbueno.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","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":"2017-01-27T14:09:37.000Z","updated_at":"2025-07-02T23:59:09.000Z","dependencies_parsed_at":"2022-11-03T21:00:45.313Z","dependency_job_id":null,"html_url":"https://github.com/thiagopbueno/pyddlib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thiagopbueno/pyddlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Fpyddlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Fpyddlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Fpyddlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Fpyddlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagopbueno","download_url":"https://codeload.github.com/thiagopbueno/pyddlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagopbueno%2Fpyddlib/sbom","scorecard":{"id":880844,"data":{"date":"2025-08-11","repo":{"name":"github.com/thiagopbueno/pyddlib","commit":"b506d531aa6f57abfde477eb9880e216f6d3ed21"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}}]},"last_synced_at":"2025-08-24T08:08:18.638Z","repository_id":62579813,"created_at":"2025-08-24T08:08:18.638Z","updated_at":"2025-08-24T08:08:18.638Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["add","algebraic-data-types","bdd","decision-diagrams","logic","symbolic-manipulation"],"created_at":"2026-01-16T10:13:45.309Z","updated_at":"2026-01-16T10:13:45.419Z","avatar_url":"https://github.com/thiagopbueno.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyddlib\n=======\n\npyddlib is a Python3 library for manipulating decision diagrams (DD).\n\nIt is intended to follow (as much as possible) the notation and overall\nconstruction proposed in the following papers:\n\n[1] Bryant, Randal E. **Graph-based algorithms for boolean function\nmanipulation**. Computers, IEEE Transactions on 100, no. 8 (1986):\n677-691.\n\n[2] Brace, Karl S., Richard L. Rudell, and Randal E. Bryant. **Efficient\nimplementation of a BDD package**. In Proceedings of the 27th ACM/IEEE\ndesign automation conference, pp. 40-45. ACM, 1991.\n\n[3] Bahar, R. Iris, Erica A. Frohm, Charles M. Gaona, Gary D. Hachtel,\nEnrico Macii, Abelardo Pardo, and Fabio Somenzi. **Algebraic decision\ndiagrams and their applications**. Formal methods in system design 10,\nno. 2-3 (1997): 171-206.\n\nInstall\n-------\n\nIt is required to have Python3 installed.\n\n::\n\n    $ pip3 install pyddlib\n\n\nUsage\n-----\n\nBinary Decision Diagrams (BDDs)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou create BDDs from constants and variables by composing boolean\nfunctions with logical operations AND (\u0026), OR (\\|), XOR (^) and NOT (-).\n\n.. code:: python\n\n    from pyddlib.bdd import BDD\n\n    one  = BDD.one()\n    zero = BDD.zero()\n    print(\"== True ==\")\n    print(one)\n    print(\"== False ==\")\n    print(zero)\n\n    x1 = BDD.variable(1)\n    x2 = BDD.variable(2)\n    x3 = BDD.variable(3)\n    print(\"=== x1 ===\")\n    print(x1)\n\n    print(\"=== NOT x1 ===\")\n    print(~x1)\n\n    print(\"=== x1 AND x2 ===\")\n    print(x1 \u0026 x2)\n\n    print(\"=== x1 OR x2 ===\")\n    print(x1 | x2)\n\n    print(\"=== x1 XOR x2 ===\")\n    print(x1 ^ x2)\n\n    bdd1 = ~x1 | (x2 ^ ~x3)\n    if (bdd1 \u0026 one) == bdd1:\n        print('True is the neutral element for AND operation!')\n\n    bdd2 = ~(~x2) ^ (~(x1 | x3))\n    if (bdd2 | zero) == bdd2:\n        print('False is the neutral element for OR operation!')\n\n    bdd3 = x1 \u0026 ~x1\n    if bdd3.is_zero():\n        print('You can check contradiction with is_zero() funtion!')\n\n    bdd4 = x1 | ~x1\n    if bdd4.is_one():\n        print('You can check tautology with is_one() function!')\n\n    bdd5 = ~(x1 | ~(x2 \u0026 ~x3))\n    if (bdd5 ^ bdd5).is_zero():\n        print('You can check equivalence with XOR!')\n\n    if (x1 \u0026 x2) == (x2 \u0026 x1):\n        print('Commutative law works for boolean functions!')\n\n    if x1 \u0026 (x2 \u0026 x3) == (x1 \u0026 x2) \u0026 x3:\n        print('Associative law works for boolean functions!')\n\n    if (x1 \u0026 (x2 | x3)) == ((x1 \u0026 x2) | (x1 \u0026 x3)):\n        print('Distributivity law works: AND distributes over OR!')\n\n    if (x1 | (x2 \u0026 x3)) == ((x1 | x2) \u0026 (x1 | x3)):\n        print('Distributivity law works: OR distributes over AND!')\n\n    bdd6 = ~(x1 \u0026 ~(~x2 | x3))\n    valuation1 = { 1: True, 2: True, 3: False }\n\n    if bdd6.restrict(valuation1).is_zero():\n        print('You can evaluate the function with restrict!')\n\n    valuation2 = { 1: True }\n    if bdd6.restrict(valuation2) == (~x2 | x3):\n        print('You can also partially evaluate the function with restrict!')\n\n\nAlgebraic Decision Diagrams (ADDs)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou create ADDs from constants and variables by composing arithmetic operations functions +, -, *, /.\n\n.. code:: python\n\n    from pyddlib.add import ADD\n\n    c0 = ADD.constant(0.0)\n    c1 = ADD.constant(1.0)\n    c2 = ADD.constant(2.0)\n    print(\"=== c1 ===\")\n    print(c1)\n    print(\"=== c2 ===\")\n    print(c2)\n\n    x1 = ADD.variable(1)\n    x2 = ADD.variable(2)\n    x3 = ADD.variable(3)\n    print(\"=== x1 ===\")\n    print(x1)\n\n    print(\"=== NOT x1 ===\")\n    print(~x1)\n\n    print(\"=== x1 * x2 * c1 ===\")\n    print(x1 * x2 * c2)\n\n    print(\"=== (x1 + x2) * c2 ===\")\n    print((x1 + x2) * c2)\n\n    print(\"=== x1 - x2 ===\")\n    print(x1 - x2)\n\n    add1 = ~x1 + (x2 * ~x3)\n    if (add1 * c1) == add1:\n        print('ADD.constant(1.0) is the neutral element for multiplication!')\n\n    add2 = ~(~x2) * (~(x1 + x3))\n    if (add2 + c0) == add2:\n        print('ADD.constant(0.0) is the neutral element for addition!')\n\n    add3 = x1 * ~x1\n    if add3 == c0:\n        print('You can check contradiction by comparing with ADD.constant(0.0) !')\n\n    add4 = x1 + ~x1\n    if add4 == c1:\n        print('You can check tautology by comparing with ADD.constant(1.0) !')\n\n    if (x1 * x2) == (x2 * x1) and (x1 + x2) == (x2 + x1):\n        print('Commutative law works for multiplication and addition!')\n\n    if x1 * (x2 * x3) == (x1 * x2) * x3 and x1 + (x2 + x3) == (x1 + x2) + x3:\n        print('Associative law works for multiplication and addition!')\n\n    if (x1 * (x2 + x3)) == ((x1 * x2) + (x1 * x3)):\n        print('Distributivity law works: multiplication distributes over addition!')\n\n    add5 = x1 * x2 + x3 * c2\n    valuation = { 1: True, 2: False, 3: True }\n\n    if add5.restrict(valuation).value == 2.0:\n        print('You can evaluate the function with restrict!')\n\n    valuation2 = { 1: True }\n    if add5.restrict(valuation2) == (x2 + x3 * c2):\n        print('You can also partially evaluate the function with restrict!')\n\n\nLICENSE\n-------\n\nCopyright (c) 2017 Thiago Pereira Bueno All Rights Reserved.\n\npyddlib is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Lesser General Public License as published by the\nFree Software Foundation, either version 3 of the License, or (at your\noption) any later version.\n\npyddlib is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\nLicense for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with pyddlib. If not, see http://www.gnu.org/licenses/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagopbueno%2Fpyddlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagopbueno%2Fpyddlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagopbueno%2Fpyddlib/lists"}