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 3 4221
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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
|
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
|
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
|
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:
| |
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
|
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
|
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...
|
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...
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |