473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 4184
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
by: greg | last post by:
Discussion is invited on the following proto-PEP. ------------------------------------------------------------- PEP ??? - Overloadable Boolean Operators...
17
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
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
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
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...
1
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...
11
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...
270
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...
1
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:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.