BOOL(1) General Commands Manual BOOL(1)

boolLogical expression tester

bool -hVv

bool [-dt] filename

bool is a logical expression tester. It takes a logical expression as input, containing logical variable names, parentheses and logical operators, and for each combination of values of different variables outputs the values of variables and the evaluated value of the expression, separated by TAB characters (like a TSV table).

Debug mode: output extended debug information in addition to the simulation output.
Show option summary.
Output syntax tree instead of the simulation output. AST is output in the format which can be piped to dtree(1).
Show full version information: like -v, followed by copyright notice.
Show version information: program version and source git repository commit date.

An expression expr can be one of the following:

ident
Variable identifier. Identifiers consist of one or more uppercase and lowercase latin letters and digits. An identifier cannot start with a digit.
expr | expr
Logical OR (disjunction).
expr & expr
Logical AND (conjunction).
expr ^ expr
Logical XOR (exclusive or).
expr => expr
Logical implication.
expr
Logical NOT (negation).
expr )
Parentheses (force operator precedence).

The bool utility exits 0 on success, and >0 if an error occurs.

For errors caused by the unsuccessful calls to libc functions setting errno, that value is returned as the exit status. Otherwise, the exit status is one of the following:

Command line argument is not recognized.
va_arg() returned NULL (should not happen).
There was an error during the parsing of input, or the root node of AST is NULL.

$ printf "~A1 | A2 & A3\n" | bool | tsvtable -n -saa
+------------------+------------------+------------------+------------------+
|A1                |A2                |A3                |Result            |
|F                 |F                 |F                 |T                 |
|F                 |F                 |T                 |T                 |
|F                 |T                 |F                 |T                 |
|F                 |T                 |T                 |T                 |
|T                 |F                 |F                 |F                 |
|T                 |F                 |T                 |F                 |
|T                 |T                 |F                 |F                 |
|T                 |T                 |T                 |T                 |
+------------------+------------------+------------------+------------------+
$ printf "~A1 | A2 & A3\n" | bool -t | dtree -sa
OR
+--NOT
|  `--[ID(0) = "A1"]
`--AND
   +--[ID(1) = "A2"]
   `--[ID(2) = "A3"]

Strahinya Radich <sr@strahinja.org>, 2026

Bugs can be reported using the ticket tracker at: https://todo.sr.ht/~strahinja/bool

OpenBSD 7.8 January 21, 2026 BOOL(1)