1.0.8 • Published 2 years ago

truth-table-parser v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Truth Table Parser

A REPL tool and library for generating truth tables from a logical proposition (see examples).

Demo

asciicast

Install

As a command line tool

npm install -g truth-table-parser
truth-table-parse # drops you into a REPL where you can run your propositions.

As a library

npm install truth-table-parser

Examples

> p
> !p
> p & q
> (!p) & q
> (p => q)
> !(p | q)
> (p <=> q)
> !(p => q)
> ((p => q) & (r => s))

Backus-Naur Form (BNF)

The backus naur form for the syntax of a proposition.

<TTP> ::= <PROPOSITION>*

<PROPOSITION> ::= <name> |
                  <UNARY-PROPOSITION> |
                  <BINARY-PROPOSITION>

<UNARY-PROPOSITION> ::= <UNARY-CONNECTIVE> <name> |
                        <UNARY-CONNECTIVE> <BINARY-PROPOSITION>

<BINARY-PROPOSITION> ::= "(" <PROPOSITION> <BINARY-CONNECTIVE> <PROPOSITION> ")"

<UNARY-CONNECTIVE> = "!"
<BINARY-CONNECTIVE> = "&" | "|" | "=>" | "<=>"
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.0.1

3 years ago