conditional expression sought

Elaine Jackson elainejackson7355 at
Fri Jan 30 06:49:29 CET 2004

This is just for theoretical interest. The A_i's and B_i's were meant as

"Corey Coughlin" <corey.coughlin at> wrote in message
news:a8623416.0401291625.594a9768 at
| "Elaine Jackson" <elainejackson7355 at> wrote in message
news:<pRbSb.330334$ts4.37644 at pd7tw3no>...
| > If bool(B_i)==True for 1<=i<=n and j is the smallest i with bool(A_j)==True,
| > then the evaluation of (A_1 and B_1) or ... or (A_n and B_n) returns B_j
| > evaluating any other B_i. This is such a useful mode of expression that I
| > like to be able to use something similar even when there is an i with
| > bool(B_i)==False. The only thing I can think of by myself is ( (A_1 and
| > or ... or (A_n and [B_n]) )[0], and I can't be satisfied with that for
| > reasons. Does anybody know a good way to express this? Any help will be
| > appreciado.
| >
| > Peace
| Oh, this must be part of your truth table script.  Interesting,
| looking for something like a fast SOP evaluator, or more like a
| function evaluation mechanism?  It would probably be most useful to
| share your containers for A and B.  Are you really going to have
| variables named A_1 to A_n, or will you just have a vector A[0:n]?
| The vector would probably be easier to deal with.  Using integer
| representations for your boolean vectors is a good idea, and will
| probably buy you enough speed that you won't need a more serious form
| of short circuit evaluation, I imagine.  Unless your vectors are very
| large indeed.  Hmm...

More information about the Python-list mailing list