{"id":21717283,"url":"https://github.com/shnarazk/mios","last_synced_at":"2025-04-12T20:13:38.048Z","repository":{"id":56848118,"uuid":"44955922","full_name":"shnarazk/mios","owner":"shnarazk","description":"A SAT solver written in Haskell.","archived":false,"fork":false,"pushed_at":"2018-10-07T09:13:40.000Z","size":4514,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T20:13:31.106Z","etag":null,"topics":["haskell","sat-solver"],"latest_commit_sha":null,"homepage":"https://gitlab.com/satisfiability01/mios/","language":"Haskell","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/shnarazk.png","metadata":{"files":{"readme":"README.md","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":"2015-10-26T08:40:35.000Z","updated_at":"2024-11-16T00:03:24.000Z","dependencies_parsed_at":"2022-09-07T03:10:56.839Z","dependency_job_id":null,"html_url":"https://github.com/shnarazk/mios","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Fmios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Fmios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Fmios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shnarazk%2Fmios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shnarazk","download_url":"https://codeload.github.com/shnarazk/mios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625517,"owners_count":21135514,"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":["haskell","sat-solver"],"created_at":"2024-11-26T01:15:56.696Z","updated_at":"2025-04-12T20:13:38.018Z","avatar_url":"https://github.com/shnarazk.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mios -- Minisat-based Implementation and Optimization Study\n----\n\n`Mios` is yet another minisat-based SAT solver implementation in Haskell, as\na part of my research theme.\n\n- [ChangeLog](ChangeLog.md)\n\n### \u003e Features\n\n* fundamentally it is developed based on Minisat-1.14 and 2.2.0.\n  * Firstly, version 1.0 was based on N. Een and N. Sorensson, *“An extensible SAT-solver [extended version 1.2],”* in 6th Int. Conf. on Theory and Applications of Satisfiability Testing (SAT2003), 2003, pp. 502–518.\n  * Version 1.1 was a *line-to-line* translation of [MiniSat 1.14](http://minisat.se/downloads/MiniSat_v1.14.2006-Aug-29.src.zip).\n  * Version 1.2 imported some idea used in Glucose 4.0.\n  * Version 1.5 uses Literal Block Distance (LBD).\n  * Version 1.6 adopts new ideas: EMA, ACIDS and so on.\n* runs in `IO` monad, uses `Data.Primitive.ByteArray` mainly and `reallyUnsafePtrEquality`.\n* very fast, compared with other SAT solvers written in Haskell; see below.\n\n#### benchmark results\n\n- SAT-Competition 2017 Main track, running 3 jobs *in parallel* with a 510 second timeout on Intel Core i7-3930K @ 12x 3.8GHz\n  (Therefore results near the threshold should be affected by other threads more or less.)\n\n![Cactus plot with Mios-1.6.1: SAT Competition 2017 main](https://shujinarazaki.gitlab.io/pages/images/mios-1.6.1.png)\n\n### \u003e Install\n\n##### Requirements\n\n- ghc-8.0.1 or upper (By deleting `default-extensions` from mios.cabal, you can use ghc-7.10.x.)\n- [Stack](http://www.haskellstack.org/)\n- If you want to build with cabal, please use the cabal file under utils directory.\n\n##### Stack\n\n```\ngit clone https://github.com/shnarazk/mios\nstack init --resolver lts-11.X  # for ghc-8.2.X\nstack install\n```\n\n##### Hackage/Cabal\n\nMios is registered in [hackage](http://hackage.haskell.org/package/mios) now.\n\n```\ncabal install mios\n```\n\n### \u003e Usage\n\n##### * As a standalone program\n\n```\n$ mios a.cnf\nan assignment :: [Int]\n\n$ mios --help\nmios 1.6.1 https://github.com/shnarazk/mios/\nUsage: mios [OPTIONS] target.cnf\n  -d 0.95   --variable-decay-rate=0.95  [solver] variable activity decay rate (0.0 - 1.0)\n  -c 0.999  --clause-decay-rate=0.999   [solver] clause activity decay rate (0.0 - 1.0)\n            --Rb=1.2                    [solver] expansion rate for blocking restart (\u003e= 1.0)\n            --Rf=1.01                   [solver] expansion rate for forcing restart (\u003e= 1.0)\n            --Rs=100.0                  [solver] a fixed number of conflicts between restarts\n  -:        --validate-assignment       [solver] read an assignment from STDIN and validate it\n            --validate                  [solver] self-check (satisfiable) assignment\n  -o file   --output=file               [option] filename to store result\n  -v        --verbose                   [option] display misc information\n  -X        --hide-solution             [option] hide solution\n            --benchmark=-1/0/N          [devel] No/Exhaustive/N-second timeout benchmark\n            --sequence=NUM              [devel] set 2nd field of a CSV generated by benchmark\n            --dump=0                    [devel] dump level; 1:solved, 2:reduction, 3:restart\n  -h        --help                      [misc] display this message\n            --version                   [misc] display program ID\n```\n\nIf you have GNU parallel, Mios works well with it:\n\n```\nparallel \"mios --benchmark=0 --sequence={#} -o {.cnf}.result {}\" ::: *.cnf\n```\n\n##### * In Haskell\n\n```haskell\nmodule Main where -- this is sample.hs in app/\nimport SAT.Mios (CNFDescription (..), solveSAT)\n\nclauses = [[1, 2], [1, 3], [-1, -2], [1, -2, 3], [-3]] :: [[Int]]\ndesc = CNFDescription 3 5 Nothing    -- #vars, #clauses, Just pathname or Nothing\n\nmain = do\n  asg \u003c- solveSAT desc clauses    -- solveSAT :: Traversable m =\u003e CNFDescription -\u003e m [Int] -\u003e IO [Int]\n  putStrLn $ if null asg then \"unsatisfiable\" else show asg\n```\n\n```\n$ stack ghc app/sample.hs\n$ app/sample\n[1,-2,-3]\n```\n\nOf course, you can use Mios in ghci similarly.\n\n```\n$ stack ghci\n...\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnarazk%2Fmios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshnarazk%2Fmios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshnarazk%2Fmios/lists"}