npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

native-sat-solver-package

v1.0.2

Published

SAT Solver npm package written in C++

Readme

NPM Package: Native-Sat-Solver-Package

Tests Passing Tests Passing

Native-Sat-Solver-Addon is a SAT Solver npm addon, written in C++ to complex Boolean satisfiability problems. This addon utilizes Tseitin's transformation, a transformation technique that efficiently converts logical formulas into Conjunctive Normal Form (CNF), a standard format for SAT solving. Once a formula is in CNF, it can then be efficiently solved using the DPLL (Davis-Putnam-Logemann-Loveland) algorithm. The goal of this addon is to provide a fast and efficient tool for solving satisfiability problems in popular JavaScript frameworks.

Note: Underly SAT Solver is based on another one of my repositories which can be found here

Dependencies

The addon is dependent on node-gyp which results in the following dependencies:

Linux & MacOS

  • Python v3.7, v3.8, v3.9, or v3.10

Windows

More Info

  • For more info see the node-gyp dependencies (click here))

Installation

Use the package manager npm to install native-sat-solver-package.

npm i native-sat-solver-package

Usage

The SAT Solver will accept strings as input. These input strings are representative of boolean formulas and must adhere to the following rules.

Rules

Operators

  1. *: represents the boolean AND operator
  2. +: represents the boolean OR operator
  3. -: represents the boolean NOT operator

Order of Operations

The order of operations will be enforeced as follows with 1 being the higest order and 4 being the lowest order.

  1. ( or ) (Paranthesis)
  2. - (NOT)
  3. * (AND)
  4. + (OR)

Grammar Rules

  1. Variable names must start with a character of the alphabet (uppercase or lowercase)
  2. Variable names can consist of letters and digits
  3. Variable length must be less than 11 characters
  4. Can use arbitrary amounts of whitespace between terms of the grammar

Example Input Strings

Here are some examples input strings:

a+c
a*---a
 ( (-a)+(a*b)) * a * (c + -b) *-c
(a+b+c)*(a+b+-c)*(-b+a +c)*(-a*-c)
(a+b+c)*(a+b+-c)*(-b+a +c)*(a+-b+-c)*(-a+b+c)*(-a+b+-c)*(-a+-b+c)*(-a+-c+-c)
(a+b+c)*(a+b+-c)*(-b+a +c)*(a+-b+-c)*(-a+b+c)*(-a+b+-c)*(-a+-b+c)*(-a+-c+-b)
(a+b+c)*(a+b+-c)*(-b+a +c)*(a+-b+-c)*(-a+b+c)*(-a+b+-c)*(-a+-b+c)
VAr1 * -VAr1
VAr1 + -VAr1
 -((A*  B)+ C)
 (A+-B+C) * (B+C) * (-A+ C) * (B +-C) * -               (C)
(a1)*(-a1+a2) * (-a2+a3) *(-a3)
  (-B*-C * D) + (-B * -  D) + (C *D) + (B)         
(B+C+-D)  *(D+B)*(-C+-D)* (-B)

Using the Addon

const SAT = require('native-sat-solver-package')

// returns 'sat'
console.log(SAT.solve('Var1 + -Var1'))

// returns 'usat'
console.log(SAT.solve('a*---a'))

// returns 'unsat'
console.log(SAT.solve('(B+C+-D)*(D+B)*(-C+-D)*(-B)'))

Tests

This package uses Mocha for testing.

npm run test

Local Builds

The package can be run locally after globally installing node-gyp.

node-gyp rebuild

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT