thealienz1 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
I have been working a program for quite some time now, and well I have gotten to a certain point, which I have stumped myself. What else is new?
Currently I am running a program that generates logical equestions, for example: a0 AND a1 OR d0. My program uses AND, OR for operators and a0,a1,d0,d1,d2,d3 for variables. I noticed as my program runs I get into a certain problem. Becuase my equations progressivly get bigger and bigger I get stuck with enormous equations, but some that have repeating values.
By repeating values take a look at the following equation:
a0 AND a0 OR d1 OR d1 AND d0
This equations can be simplified to a simpler equation:
a0 OR d1 AND d0
because value that are AND with itself or ORed is just its original value.
I was using regex, but just wanted to see others solution to the problem.
Regards,
Justin Archie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simplify logical equations
by Corion (Patriarch) on Oct 19, 2004 at 08:55 UTC | |
by ysth (Canon) on Oct 19, 2004 at 10:30 UTC | |
by Corion (Patriarch) on Oct 19, 2004 at 10:48 UTC | |
by thealienz1 (Pilgrim) on Oct 19, 2004 at 09:07 UTC | |
|
Re: simplify logical equations
by zentara (Cardinal) on Oct 19, 2004 at 11:54 UTC | |
|
Re: simplify logical equations
by periapt (Hermit) on Oct 19, 2004 at 13:18 UTC | |
|
Re: simplify logical equations
by Anonymous Monk on Oct 19, 2004 at 12:25 UTC | |
|
Re: simplify logical equations
by TedPride (Priest) on Oct 19, 2004 at 12:32 UTC |