Solve Logic Tables with custom sizes and claims
Requires Node.JS Version >= 10
yarn install
Edit src/index.ts
to fit your use case:
size
determines the amount of people (A, B, C...) to take into account.
claims
is an array of functions that return either true
or false
when given the values of a generated logic input table.
Claims must be a function that accepts boolean inputs in alphabetical order
(a, b, c, d, e, f...) => boolean
To include only b
and d
, a
and c
must still be included,
but can be marked unused with a _
(underscore).
(_a, b, _c, d) => boolean
A claim should begin with an
eq(letter, ...)
operand, showing that (i.e.) A
claims something.
Example 1: A claims B is lying
(a, b) => eq(a, not(b))
is equivalent to: A ⇔ ¬B
Example 2: C claims A and B are lying
(a, b, c) => eq(c, and(not(a), not(b)))
C ⇔ (¬A ∧ ¬B)
Build before you run:
yarn run build
yarn run start
👤 TMUniversal
- Github: @TMUniversal
Copyright © 2021 TMUniversal.
This project is MPL-2.0 licensed.