Sujet : Re: help with a logic algorithm
De : anton.txt (at) *nospam* g{oogle}mail.com (Anton Shepelev)
Groupes : comp.lang.cDate : 03. Apr 2024, 12:33:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240403143329.803ffa6eb0f1e166b4f3e4e0@g{oogle}mail.com>
References : 1
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Thiago Adams:
I need an algorithm that finds the possible states of
variables used in "ifs"
The industrial approach (e.g. from digital circuitry) is to
convert the expression into a minimal sum of truth
constituents. There are several algorithms to do so
efficiently, i.e. to find the minimal coverage of the truth
table by truth constituents. The only ones I know are by a
Russian author published in a Russian book by logic, so I
cannot provide a useful reference.
A family of appraches is based on the Karnaugh map:
https://en.wikipedia.org/wiki/Karnaugh_mapIf you expressions are simple, however, a direct enumaration
of 2^n combinations could work.
-- () ascii ribbon campaign -- against html e-mail/\ www.asciiribbon.org -- against proprietary attachments