Skip to content

ltentrup/SATSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAT Solver Interface for Swift

This package provides only an interface to a SAT solver, no implementation. For packages that provide an implementation, see

The interface is defined as follows:

public enum SATSolverResult {
    case satisfiable
    case unsatisfiable
}

public enum SATSolverLiteralValue {
    case positive
    case negative
    case unassigned
}

public protocol SATSolver {
    associatedtype Literal
    
    var maxVar: Literal { get }
    
    init()
    func new() -> Literal
    func add(literal: Literal)
    func assume(literal: Literal)
    func solve() -> SATSolverResult
    func value(of literal: Literal) -> SATSolverLiteralValue
    func failed(literal: Literal) -> Bool
}

About

A SAT Solver Interface for the Swift Programming Language

Resources

Stars

Watchers

Forks

Packages

No packages published