Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pythonic use of logic

Name: Anonymous 2013-06-27 11:43

I have noticed a disturbing trend in the Python community. The basic rule of Python is that there should be only one way to do a thing, and there are several logical operators in use. The proper way to use logic in Python is to only use one operator. To replace them all, we should use the NAND operator ("|").

For instance, consider the statement W↔(X∧(Y∨¬Z)). It is an ugly mess! It uses four different operators when only one should suffice.

This can obviously be reduced to only three operators: (¬W∨(¬(X∧Y)∧¬(X∧¬Z)))∧(((X∧Y)∧(X∧¬Z))∨W)

But this is not nearly far enough. By using the simple rules (A∨B) = (A|A)|(B|B), (A∧B)=(A|B)|(A|B), and ¬A=(A|A) (which should be self-evident, use a truth table to verify), we can reduce this entire expression to a beautiful (((((W|W)|(W|W))|((((X|Y)|((X|(Z|Z))|(X|(Z|Z))))|((X|Y)|((X|(Z|Z))|(X|(Z|Z)))))|(((X|Y)|((X|(Z|Z))|(X|(Z|Z))))|((X|Y)|((X|(Z|Z))|(X|(Z|Z)))))))|((W|W)|(((((X|Y)|(X|Y))|(X|(Z|Z)))|(((X|Y)|(X|Y))|(X|(Z|Z))))|((((X|Y)|(X|Y))|(X|(Z|Z)))|(((X|Y)|(X|Y))|(X|(Z|Z)))))))|((((W|W)|(W|W))|((((X|Y)|((X|(Z|Z))|(X|(Z|Z))))|((X|Y)|((X|(Z|Z))|(X|(Z|Z)))))|(((X|Y)|((X|(Z|Z))|(X|(Z|Z))))|((X|Y)|((X|(Z|Z))|(X|(Z|Z)))))))|((W|W)|(((((X|Y)|(X|Y))|(X|(Z|Z)))|(((X|Y)|(X|Y))|(X|(Z|Z))))|((((X|Y)|(X|Y))|(X|(Z|Z)))|(((X|Y)|(X|Y))|(X|(Z|Z)))))))). This is much more in line with the spirit of python than using multiple things when a single, simple operator will suffice.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-06-28 8:30

>>21,25,26
Looks liekw e have a acse of the typacial "sofowater idiotss whoa know notig about REAL harware but just the acrap fedd to them byt extboosk...

IC desgign is a COMPELELY different discpline. BOTH regulart gates and COMPUOND oes are usedin. AOI OAI

apollo computer used all3 -input RTL NOR gats. In NMOS NOR is faster than NAND becase the paraalel pulldowns.
http://www.amazon.com/VLSI-Design-Circuits-Michael-Vai/dp/0849318769
http://www.cmosvlsi.com/ http://www.mosis.com/pages/support/text-books
Nowgo edcate yourselves.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List