@aureooms/js-sat

    3.0.0 • Public • Published

    😆 @aureooms/js-sat


    © xkcd.com

    Boolean formula satisfiability algorithms for JavaScript. See docs. Parent is @aureooms/js-algorithms. For a polynomial time algorithm for the 2SAT problem see @aureooms/js-2sat.

    let instance = sat.from.signs( [ [ -1 , 2 , 3 ] , [ -2 , -4 , 5 ] , [ 1 , -5 ] ] ) ;
    // or
    // let instance = sat.from.keys(
    // [
    //   [ [ false , '1' ] , [ true , '2' ] , [ true , '3' ] ] ,
    //   [ [ false , '2' ] , [ false , '4' ] , [ true , '5' ] ] ,
    //   [ [ true , '1' ] , [ false , '5' ] ]
    // ]
    // ) ;
    sat.decide( instance ) ; // true
    sat.verify( instance , sat.solve( instance ).next( ).value ) ; // true
    for ( let certificate of sat.solve( instance ) ) {
        console.log( instance.assignment( certificate ) ) ;
    }

    License Version Tests Dependencies Dev dependencies GitHub issues Downloads

    Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

    📜 Reference

    Install

    npm i @aureooms/js-sat

    DownloadsWeekly Downloads

    1

    Version

    3.0.0

    License

    AGPL-3.0

    Unpacked Size

    579 kB

    Total Files

    14

    Last publish

    Collaborators

    • aureooms