{"id":13749331,"url":"https://github.com/jix/minimal_models_example","last_synced_at":"2025-03-27T05:29:34.473Z","repository":{"id":148208856,"uuid":"326823516","full_name":"jix/minimal_models_example","owner":"jix","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-04T22:45:06.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-22T22:33:14.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-01-04T22:32:29.000Z","updated_at":"2021-01-04T22:45:08.000Z","dependencies_parsed_at":"2023-06-01T17:15:23.963Z","dependency_job_id":null,"html_url":"https://github.com/jix/minimal_models_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jix%2Fminimal_models_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jix%2Fminimal_models_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jix%2Fminimal_models_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jix%2Fminimal_models_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jix","download_url":"https://codeload.github.com/jix/minimal_models_example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245790628,"owners_count":20672541,"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","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":[],"created_at":"2024-08-03T07:00:59.532Z","updated_at":"2025-03-27T05:29:34.440Z","avatar_url":"https://github.com/jix.png","language":"Rust","funding_links":[],"categories":["Unclassified"],"sub_categories":["Libraries"],"readme":"# Minimal models\n\nUses a SAT solver to find minimal partial assignments that are model of a CNF\nformula. Supports incremental clause additions. Quick and dirty implementation\nto illustrate the technique.\n\nThis works by maintaining two SAT solver instances, one for the CNF formula\n(the positive solver) and one for its negation (the negative solver). As the\nnegation of a CNF formula is in DNF, we use the Tseytin transformation to\nconvert the resulting DNF back into an equisatisfiable CNF with auxiliary\nvariables.\n\nTo find a model we first query the positive solver and obtain a complete\nassignment that is a model of our formula (if it exists). If we query the\nnegative solver using a model (complete or partial) of our formula as\nassumptions, the result will be UNSAT. The negative solver will then report a\n(not necessarily strict) subset of assumptions that are sufficient for\nfalsifying the formula of the negative solver (called failed literals).\n\nWe can minimize the model by iteratively removing a literal from the assignment\nand querying the negative solver. If the result becomes SAT, we know the\nremoved literal is essential and add it back to the assignment. If the result\nremains UNSAT, we can permanently remove that candidate and continue with\nanother literal not known to be essential until none are left. Each time the\nresult is UNSAT we can also remove all literals not among the failed literals.\n\nI don't have anything to cite right now, but I'm pretty sure this is a known\ntechnique, very similar ideas are used all over the place as part of algorithms\nfor MaxSAT, QBF, interpolant generation etc.\n\n## Usage\n\n`cat example.cnf - | cargo run --release`\n\nThen press return to find a minimal model and add a clause blocking the found\nmodel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjix%2Fminimal_models_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjix%2Fminimal_models_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjix%2Fminimal_models_example/lists"}