Boolean is a small programming language designed specifically to manipulate boolean expressions. It can generate truth tables, evaluate simplification rules, and do a little bit of inference.
Mess around with a demo (compiled from Rust to WebAssembly):
Boolean can parse the following expressions and operations:
!(a & b))
a & b)
a | b)
p => q)
p <=> q)
It also understands some of its own syntax:
Table (a & b | c),
Satisfy (p => q))
The language allows commands to control the evaluation of their own arguments. This mechanism is
somewhat similar to the
Hold* family of function attributes in the Wolfram Language--each function gets to
control how its children in the AST are handled.
Boolean understands the following functions:
With expr assumptions
With substitutes a set of concrete
> With (a | b) a T > With (a & b) (!a) F > With (a & b & !c & d) (b & !c) a & d
Table expr [var...]
Table generates truth tables for
expr, in disjunctive normal form (e.g.
a | !b).
> Table (a | b) a & !b | !a & b | b & a > Table ( (a & b) => q ) a b !a & !b | b & !a | !b & a
Satisfy finds a set of bindings which satisfy
> Satisfy (a & b & (!a | b)) b & a
Boolean has both a CLI (in
./cli) and a web UI (in
./www). For the web UI, a server isn't
required--the core is compiled to WebAssembly, and shipped directly to the browser.
# running the CLI $ cd cli && cargo run # build the web UI (requires cargo-web and cross) $ cd www && yarn install && make