Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.1%) to scientific vocabulary
Repository
Library to formulate SAT problems in .NET
Basic Info
- Host: GitHub
- Owner: sfiruch
- License: mit
- Language: C#
- Default Branch: master
- Size: 26.3 MB
Statistics
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
SATInterface
SATInterface is a .NET library to formulate SAT problems
Installation
Add a reference to the NuGet Package deiruch.SATInterface.
Features
- Maximize or minimize linear objective functions (3 strategies)
- Enumerate all solutions
- Supports linear combinations
- Convenient .NET operator overloading
- Simplify Boolean formulas
- Translate Boolean formulas to CNF
- Includes algorithms for
- Counting (Totalizer)
- At-most-one-constraints (7 implementations)
- Exactly-one-constraints (9 implementations)
- Exactly-k-constraints (4 implementations)
- Unsigned integer arithmetic (Addition, Subtraction, Multiplication, Shifting)
- Export to DIMACS files
- Includes Kissat (https://github.com/arminbiere/kissat), CaDiCaL (https://github.com/arminbiere/cadical) and CryptoMiniSAT (see https://github.com/msoos/cryptominisat)
Usage example: Sudoku
~~~~cs using System; using System.Linq; using SATInterface;
using var m = new Model(); m.Configuration.Solver = InternalSolver.CaDiCaL; m.Configuration.Verbosity = 2;
var v = m.AddVars(9, 9, 9);
//fix the first number to 1 v[0, 0, 0] = true;
//here's alternative way to set the second number m.AddConstr(v[1, 0, 1]);
//assign one number to each cell for (var y = 0; y < 9; y++) for (var x = 0; x < 9; x++) m.AddConstr(m.Sum(Enumerable.Range(0, 9).Select(n => v[x, y, n])) == 1);
//each number occurs once per row (alternative formulation) for (var y = 0; y < 9; y++) for (var n = 0; n < 9; n++) m.AddConstr(m.ExactlyOneOf(Enumerable.Range(0, 9).Select(x => v[x, y, n])));
//each number occurs once per column (configured formulation) for (var x = 0; x < 9; x++) for (var n = 0; n < 9; n++) m.AddConstr(m.ExactlyOneOf(Enumerable.Range(0, 9).Select(y => v[x, y, n]), Model.ExactlyOneOfMethod.PairwiseTree));
//each number occurs once per 3x3 block for (var n = 0; n < 9; n++) for (var y = 0; y < 9; y += 3) for (var x = 0; x < 9; x += 3) m.AddConstr(m.Sum( v[x + 0, y + 0, n], v[x + 1, y + 0, n], v[x + 2, y + 0, n], v[x + 0, y + 1, n], v[x + 1, y + 1, n], v[x + 2, y + 1, n], v[x + 0, y + 2, n], v[x + 1, y + 2, n], v[x + 2, y + 2, n]) == 1);
m.Solve();
if (m.State == State.Satisfiable) for (var y = 0; y < 9; y++) { for (var x = 0; x < 9; x++) for (var n = 0; n < 9; n++) if (v[x, y, n].X) Console.Write($" {n + 1}"); Console.WriteLine(); } ~~~~
Owner
- Name: Simon Felix
- Login: sfiruch
- Kind: user
- Location: Switzerland
- Company: Ateleris GmbH
- Website: https://www.ateleris.ch/
- Repositories: 13
- Profile: https://github.com/sfiruch
Citation (CITATION.cff)
cff-version: 1.2.0
title: SATInterface
message: Please cite this software using these metadata.
type: software
authors:
- given-names: Simon
family-names: Felix
email: de@iru.ch
orcid: 'https://orcid.org/0000-0002-3979-128X'
url: "https://github.com/deiruch/SATInterface"
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers
Last synced: almost 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Simon Felix | de@i****h | 287 |
| Simon Felix | sf@i****h | 1 |
| de | de@C****0 | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- ErrorProne.NET.CoreAnalyzers 0.4.0-beta.1 development
- ErrorProne.NET.Structs 0.4.0-beta.1 development
- Microsoft.Windows.CsWin32 0.1.691-beta development
- coverlet.collector 3.1.2 development
- MSTest.TestAdapter 2.2.10
- MSTest.TestFramework 2.2.10
- Microsoft.NET.Test.Sdk 17.2.0
- actions/checkout v2 composite
- actions/setup-dotnet v1 composite