# vulcan

> A resolution-based propositional logic tool

Latest version **0.2.1** (published 2016-06-27) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install vulcan
pnpm add vulcan
yarn add vulcan
bun add vulcan
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2016-06-27 |
| First published | 2015-09-01 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 61 |
| Author | Ryan Marcus |
| Maintainers | ryanmarcus |
| Keywords | propositional, logic |

## Links

- npm: https://www.npmjs.com/package/vulcan
- Repository: https://github.com/RyanMarcus/vulcan
- Homepage: https://github.com/RyanMarcus/vulcan#readme
- Issues: https://github.com/RyanMarcus/vulcan/issues
- npm.io page: https://npm.io/package/vulcan

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2016-06-27
- 0.2.0 — 2016-04-11
- 0.1.0 — 2015-12-19
- 0.0.9 — 2015-09-24
- 0.0.8 — 2015-09-06
- 0.0.7 — 2015-09-03
- 0.0.6 — 2015-09-03
- 0.0.5 — 2015-09-03
- 0.0.4 — 2015-09-02
- 0.0.3 — 2015-09-01
- 0.0.2 — 2015-09-01
- 0.0.1 — 2015-09-01

## README

# Vulcan

[ ![Codeship Status for RyanMarcus/vulcan](https://codeship.com/projects/445f6a20-3409-0133-a68d-56c8db4126b8/status?branch=master)](https://codeship.com/projects/100424)

A library for proving statements in propositional logic using resolution.

Vulcan uses a modified version of the excellent [lexer and parse from llang](https://github.com/pnevyk/llang).

For examples, see the tests or [this blog post](http://rmarcus.info/blog/2015/09/02/vulcan.html).


# Simple usage example

```javascript
// We are using `const` for imports because the reference will never change.`
// See more here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

const vulcan = require("vulcan");
const proof = vulcan.prove(["A -> B", // the knowledgebase
                            "B -> C", 
                            "C -> D",
                            "D -> E"],
                            "B -> D"); // the query
                            
console.log(vulcan.isProofComplete(proof)); 
console.log(proof)
```

Will output:

```
true
[ { label: 'inital expression', tree: '(A -> B)', idx: 0 },
    { label: 'eliminate implication', tree: '(!A | B)', idx: 1 },
    { label: 'inital expression', tree: '(B -> C)', idx: 2 },
    { label: 'eliminate implication', tree: '(!B | C)', idx: 3 },
    { label: 'inital expression', tree: '(C -> D)', idx: 4 },
    { label: 'eliminate implication', tree: '(!C | D)', idx: 5 },
    { label: 'inital expression', tree: '(D -> E)', idx: 6 },
    { label: 'eliminate implication', tree: '(!D | E)', idx: 7 },
    { label: 'knowledge base clause from 1',
    tree: '(!A | B)',
    idx: 8 },
    { label: 'knowledge base clause from 3',
    tree: '(!B | C)',
    idx: 9 },
    { label: 'knowledge base clause from 5',
    tree: '(!C | D)',
    idx: 10 },
    { label: 'assume for a contradiction', tree: 'B', idx: 12 },
    { label: 'assume for a contradiction', tree: '!D', idx: 13 },
    { label: 'resolve of 9 and 12',
    tree: 'C',
    idx: 22,
    req: [ 9, 12 ] },
    { label: 'resolve of 10 and 13',
    tree: '!C',
    idx: 27,
    req: [ 10, 13 ] },
    { label: 'resolve of 22 and 27',
    tree: false,
    idx: 109,
    req: [ 22, 27 ] } ]
```

---
_Source: https://npm.io/package/vulcan · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
