473,776 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to simplifying boolean algebra expression?

Hi all

I need do the following based on Boolean Algebra
ex 1. (M271/M272/M651)+(450/965)/M642/M646

All possible result
M271 + 450
M271 + 965
M272 + 450
M272 + 965
M651 + 450
M651 + 965
M642
M646

ex 2 M271/M646+M006/M651+M013
M271 + M006 + M013
M646 + M006 + M013
M271 + M651 + M013
M646 + M651 + M013

Do somebody no where I can find a code library or code to help
me to break up any Boolean Algebra expression into all possible result

Thanks in advance

PS. I also have more complex expression

Apr 11 '06 #1
3 4218
Regardt wrote:
I need do the following based on Boolean Algebra
ex 1. (M271/M272/M651)+(450/965)/M642/M646

All possible result <snip> Do somebody no where I can find a code library or code to help
me to break up any Boolean Algebra expression into all possible result


What are the rules for breaking it up?
Commutativity/associativity/precedence of operators?

Andrew
Apr 11 '06 #2
Thanks for the reply

The basic rules is as follows

/ (=OR),
+ (=AND),
- (=NOT)

The BRACKET is evaluated first, as is also the case in mathematics.
The AND is always evaluated before the OR.
The NOT is shown by the '-' sign which always refers directly to the
code or bracketed expression that it precedes.

There are big variety of different rules depending on the complexity of
the expression

Apr 12 '06 #3

As said, I believe the best thing is to use the underlying VB (or
whatever .net language)
compiler (in case, overloading operators, if you want to change the
syntactical look):

(see for instance:
http://www.developer.com/net/vb/article.php/3512311)

You could embark yourself in the construction of a parser, but unless
you do it for personal research, I wouldn't advise you to that way: you
would be reinventing a *difficult* wheel...

....anyway if you do it just for fun and to learn, it can be a very good
and instructive experience...

-tom

Regardt ha scritto:
Thanks for the reply

The basic rules is as follows

/ (=OR),
+ (=AND),
- (=NOT)

The BRACKET is evaluated first, as is also the case in mathematics.
The AND is always evaluated before the OR.
The NOT is shown by the '-' sign which always refers directly to the
code or bracketed expression that it precedes.

There are big variety of different rules depending on the complexity of
the expression


Apr 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2529
by: greg | last post by:
Discussion is invited on the following proto-PEP. ------------------------------------------------------------- PEP ??? - Overloadable Boolean Operators ======================================== SUMMARY This PEP proposes an extension to permit objects to define their own
17
2549
by: Rahul | last post by:
Hi. Well is there an open source computer algebra system written in python or at least having a python interface? I know of 2 efforts: pythonica and pyginac...are there any others? rahul
0
998
by: Wit Baas | last post by:
Hi all I need do the following based on Boolean Algebra ex 1. (M271/M272/M651)+(450/965)/M642/M646 All possible result M271 + 450 M271 + 965 M272 + 450 M272 + 965
0
1227
by: Regardt | last post by:
Hi all I need do the following based on Boolean Algebra ex 1. (M271/M272/M651)+(450/965)/M642/M646 All possible result M271 + 450 M271 + 965 M272 + 450 M272 + 965
6
5686
by: DavidM | last post by:
Hi, Are there any libraries for manipulating algebraic expression trees? In particular, take an expression tree and simplify it down. I'm working up the next release of PyGene, the genetic programming and genetic algorithms library. Part of PyGene works with trees holding algebraic expressions. For example, the expression:
1
2235
by: muniba | last post by:
Relational algebric expression for the following: Draw two relational algebra query trees for the following query and show that one query tree is more eficient than the other. "Give the number of treatments given by "Dr.Albert" for all the appointments made during the period January to June 2007" thanks
11
2204
by: cbmeeks | last post by:
I'm working on a project that deals with some algebra. Or, actually, just math in general. It could eventually work it's way up to more advanced math, analytics, etc. Anyway, I'm looking for ideas on how to store the actual formulas using classes. For example: class X
270
8162
by: Jordan | last post by:
Hi everyone, I'm a big Python fan who used to be involved semi regularly in comp.lang.python (lots of lurking, occasional posting) but kind of trailed off a bit. I just wrote a frustration inspired rant on my blog, and I thought it was relevant enough as a wider issue to the Python community to post here for your discussion and consideration. This is not flamebait. I love Python, and I'm not out to antagonise the community. I also...
1
2114
by: sunil | last post by:
Hello, I have a boolean expression thats specified in pre/in/post fix notations, lets assume infix for the sake of this argument. The expression can be in any of the following forms: Form A: ------------- (As1&&/||Bs1&&/||Cs1 )|| (As2&&/||Bs2&&/||Cs2)||....(Asn&&/||Bsn&&/|| Csn) with following rules: -Inner ANDs/ORs are optional but if they are specified in one nesting they must be specified in all nestings with same connector type...
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10289
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.