{"id":20367525,"url":"https://github.com/regb/cafesat","last_synced_at":"2025-03-04T19:31:46.747Z","repository":{"id":24429418,"uuid":"27830847","full_name":"regb/cafesat","owner":"regb","description":"The CafeSat SMT solver for Scala","archived":false,"fork":false,"pushed_at":"2021-10-31T12:43:50.000Z","size":5005,"stargazers_count":48,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T05:44:31.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"SMT","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/regb.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":"2014-12-10T17:21:33.000Z","updated_at":"2024-08-10T18:08:29.000Z","dependencies_parsed_at":"2022-08-22T08:10:09.279Z","dependency_job_id":null,"html_url":"https://github.com/regb/cafesat","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/regb%2Fcafesat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fcafesat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fcafesat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regb%2Fcafesat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regb","download_url":"https://codeload.github.com/regb/cafesat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241909165,"owners_count":20040756,"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-11-15T00:32:45.797Z","updated_at":"2025-03-04T19:31:46.650Z","avatar_url":"https://github.com/regb.png","language":"SMT","funding_links":[],"categories":[],"sub_categories":[],"readme":"CafeSat\n=======\n\n\u003cp align=\"center\"\u003e\n  \u003cimg height=\"300px\" src=\"/logo/cafesat2.jpg\" /\u003e\n\u003c/p\u003e\n\nThis is the official repository for the CafeSat source code. CafeSat is a\nSAT/SMT solver written entirely in Scala. CafeSat attempts provides an\nefficient command-line tool to solve SMT problems, as well as a library\nfor Scala programs that need the capabilities of SAT/SMT solvers.\n\nGetting Started\n---------------\n\nCafeSat is built with `sbt`.\n\nA jar file that can be integrated to another project can be generated with:\n\n    sbt package\n\nIf you wish to run CafeSat as a standalone tool, the jar file can be executed\nusing the JVM.  You need to invoke the `cafesat.Main` class.\n\nThe prefered way to use CafeSat as a standalone tool is to generate a runner\nscript:\n\n    sbt cafesat\n\nThen you can run CafeSat as follows:\n\n    ./target/cafesat [ OPTIONS ] [ INPUT ]\n\nTo test that the build went fine, you can, for example, try to solve a\nDimacs SAT instances:\n\n    ./target/cafesat --dimacs input.cnf\n\n\u003c!--\nTo start an interactive session in the REPL with SMT-LIB:\n\n    ./target/cafesat\n\nTo execute an SMT-LIB script you can do the following:\n\n    ./target/cafesat \u003c input.smt2\n\nwhich simply transparently redirect stdin to the content of the file. Or use:\n\n    ./target/cafesat input.smt2\n\nin which CafeSat will open the file before feeding it to the SMT solver.\n--\u003e\n\n\nOverview\n--------\n\nCafeSat is a SAT and SMT solver written entirely in Scala. Its principal aim is\nto provide a set of safe and well-understood logic solvers useable from a high\nlevel programming language such as Scala. The typical approach used in tools\nneeding automated reasoning is to rely on an exeternal executable (usually\nimplemented from C/C++). This has the drawback of needing some external\ndependencies, and also having part of the computation living outside of the\nJVM. Some solvers provide an API, which can enable finer integration between\nthe tool and the solvers, but does not solve the issue of having dependencies\nto native code.\n\nWith CafeSat, your Scala/Java application can live entirely in the JVM while\nstill using a powerful and efficient solving procedure. What you get is then\nless overhead for not needing native bindings from the JVM to the system, and a\nmuch safer control of the processes, by opposition to a native code that could\ngenerate segmentation fault and crash in a non-recoverable state.\n\nThere are several sorts of theorem provers available. The advantage with SMT\nsolvers is that they are very predictable, compared to most other families of\nprovers. They have a well defined input theories, and pack specialized\nprocedure to solve problems in those theories. Unless specified otherwise, the\nproblem they are solving is decidable. The only unpredictable part is that the\ngeneral problem is NP-complete, which means that it could run for a very long\ntime on some instances. But the general design of an SMT solver is such that it\nis exteremely efficient on any valid input, and so, in my opinion, works much\nbetter when integrated in a bigger workflow, than say a general theorem prover\nthat relies on inference rules.\n\nDocumentation\n-------------\n\nCafeSat has been designed to be used in two distinct ways. The first one is the\nclassical command-line interface, which could be used manually to play with\nsome formulas, or as part of some scripting tasks. The second one is as part of\na bigger Scala application, with an API. With the API you get direct access to\nsome low level implementation part of the solver, which gives you the\npossibility to customize it to your needs. The solver will also live in the\nsame JVM as your main application, and so you will get very precise control.\n\n\n### Command Line\n\nThe basic template for using CafeSat as a command line is:\n\n    cafesat [ OPTIONS ] [ INPUT ]\n\n`OPTIONS` can actually be interleaved with the `INPUT` and the exact ordering\ndoes not matter.\n\n`INPUT` is a filename and is facultative, if none is provided, then CafeSat\nwill read from the standard input. In some sense, providing `INPUT` is just a\nconvenient shortcut, as an equivalent behaviour could be obtained with input\nredirection:\n\n    cafesat [ OPTIONS ] \u003c cat INPUT\n\nBy default, CafeSat expects the input to be a problem in SMT-LIB 2.5, but this\nbehaviour can be overriden with the `--dimacs` option for reading SAT problem\nin DIMACS format. CafeSat will output results to the standard output, the result\ndepending on the input problem, but usually would be a single textual output such\nas `sat` or `unsat`. Logging will by default go to the standard error, so one\ncan filter any logging information using a pipe redirection as well. The default\nlogging level is warning, and usually should be quite silent. Logging level\ncan be specified using the option `--loglevel=[1-5]`. In general, if combining\nCafeSat into a pipeline of tools, it is possible to parse the problem results\nby ignoring the standard error (where logging goes) and only considering the\ncontent of the standard output (where solving result) goes. Solving result\nformat is well defined for SMT-LIB script, so it is possible to build\na stable pipeline.\n\n### Scala API\n\nCafeSat exports an API usable from Scala programs. The API is not stable\nyet and is expected to change frequently. It will NOT be backward compatible.\n\nA minimal Scala doc is available [here](http://regb.github.io/cafesat/apidocs/#cafesat.api.package).\n\nThe best way to learn the API is probably to look at some projects relying on CafeSat:\n\n  * [Cafedoku](https://github.com/regb/cafedoku)\n\nBe sure to check which version of the library is used on each project.\n\n\nLiterature\n----------\n\nCafeSat has been first presented in the [Scala'13 workshop](http://dx.doi.org/10.1145/2489837.2489839).\nHowever, note that the content of the paper is starting to get out of date.\n\nLicence\n-------\n\nCafeSat is distributed under the terms of The MIT License.\n\nAll source code in this repository is distributed under this license. The\nreference text is in the file LICENSE, no copy of the text shall be included in\nany of the source file, but it is implicitly assumed they are available under\nthe terms specified in LICENSE.\n\nBY COMMITTING TO THIS REPOSITORY, YOU ACCEPT TO RELEASE YOUR CODE UNDER\nTHE TERMS OF THE MIT LICENSE AS DESCRIBED IN THE LICENSE FILE.\n\nCopyright\n---------\n\nThe copyright for each portion of code is owned by the respective committer,\nbased on the git history. There is no per file or per function copyright as\nthis does not make sense in general. Sorry to be picky, but that's copyright\nlaw for you. More information can be found in the COPYRIGHT.md file. Each\ncopyright owner implicitly distributes all code in this repository under the\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregb%2Fcafesat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregb%2Fcafesat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregb%2Fcafesat/lists"}