boolstuff(3)

πŸ“¦
version 0.1.16 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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&x can 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:

  1. obtain the list of terms, and then
  2. 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 examples subdirectory), and
  • two testing programs (hanging out in the src/boolstuff subdirectory).

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