🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Repository files navigation

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> = "&" | "|" | "=>" | "<=>"

About

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

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages