boolstuff(3)
π boolstuff(3) β the manual, but make it cute π
okay so bestie, welcome to boolstuff(3), the manual page for a whole C++ library called BoolStuff. yes it's a real thing, yes it's iconic, and yes we're gonna get through the whole thing together. grab a strawberry π, we're going in.
β¨ NAME β¨
boolstuff β the Disjunctive Normal Form boolean expression C++ library. that's the whole name. short, sweet, slays. π
β¨ SYNOPSIS β¨
lowkey the entire synopsis is just this one line and honestly? respect the confidence.
g++ prog.cpp -lboolstuff
like, that's it. that's the vibe. compile your program, link the library, go be a main character. π
β¨ DESCRIPTION β¨
so boolstuff is a C++ library that ships with an algorithm to convert a boolean expression binary tree into the Disjunctive Normal Form. and before you ask β yes, the NOT operator is supported. we love a library that doesn't leave anyone out. π«Ά
also, there's a C API that covers most of the library's functionality, so if C is your thing, you're also invited to the party. no gatekeeping here.
now. what even is the Disjunctive Normal Form, you ask? π¦
the DNF is an ORing of ANDed terms. in other words, if you think of the OR as an additive operation and the AND as a multiplicative operation, then the DNF is literally a sum of products. it's giving math but make it fashion.
for example, the DNF of the expression a&(b|c) is:
a&b|a&c
see how the parentheses just evaporated? the DNF eliminates parentheses and gives you a normalized form of the original expression. and normalized form is easier to execute β that's the whole point, bestie. easier execution, less chaos, more slay. β¨
okay now here's the part where you have to actually pay attention, because this is the technical tea:
- the DNF produced by BoolStuff is devoid of any "useless" terms β meaning terms that are always false, like
x&y&!x. gone. deleted. not invited. - BUT the terms that form the DNF are not necessarily simplified β for example,
x&y&xcan totally still be sitting there. π
so what do you do about that? simple. when you're executing an expression in DNF, it is recommended to:
- obtain the list of terms, and then
- obtain the set of variables used in each term.
because in the case of the term x&y&x, that set will only contain x once. the set does the deduplication for you, and that's the whole trick. iykyk. π
β¨ EXAMPLES β¨
the library's source archive comes with:
- an example program (chilling in the
examplessubdirectory), and - two testing programs (hanging out in the
src/boolstuffsubdirectory).
so you're not just getting a library, you're getting a whole starter pack. π
β¨ LICENSE β¨
this program is free software; you may redistribute it under the terms of the GNU General Public License.
and this program has absolutely no warranty. none. zero. not even a little one. bestie, you are on your own out there. π
β¨ AUTHOR β¨
Pierre Sarrazin π
go check out the BoolStuff Home Page:
http://sarrazip.com/dev/boolstuff.html
and fr fr, comments are welcome. they said it themselves. so if you've got thoughts, send them.
β¨ BUGS β¨
okay this is the part where we're honest with each other. π«£
- Version 0.1.x is an unstable development version. so like, it's in its experimental era.
- the programming interface of the library and the command-line options of the accompanying commands are not necessarily fixed β meaning they could change on you. no cap.
- the documentation has not been reviewed for completeness. so if something's missing, that's why. π
not me telling you all this and still being obsessed with it, but here we are.
β¨ HISTORY β¨
storytime, bestie. πΈ
George Boole (1815β1864) was an English mathematician who helped establish modern symbolic logic, and whose algebra of logic β now called Boolean algebra β is basic to the design of digital computer circuits.
like... he invented the whole vibe. everything we're doing here with a&b|a&c traces back to him. an absolute icon. a founding father of the slay. π
okay that's the whole page!! thank you for reading the boolstuff(3) manual with me, you did amazing, i'm so proud of you. πβ¨
this page was brought to you by the BoolStuff library, and the date on the original footer is May 24th, 2016 β so go forth, convert your boolean trees, and stay normalized. mwah. π π
π¦ where this page comes from
- debian bookworm: boolstuff-dev 0.1.16-2+b1
- debian trixie: boolstuff-dev 0.1.16-2.1
- ubuntu jammy: boolstuff-dev 0.1.16-2
- ubuntu noble: boolstuff-dev 0.1.16-2build1
- ubuntu questing: boolstuff-dev 0.1.16-2.1
- ubuntu resolute: boolstuff-dev 0.1.16-2.2
- ubuntu stonking: boolstuff-dev 0.1.16-2.2
- Copyright (C) 2002-2014 Pierre Sarrazin <http://sarrazip.com/>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms