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:
Anonymous2013-06-27 12:12
write to guido, he will implement it in the next version of python 3
(((((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))))))))
It's like Perl had sex with Lisp.
I had a frightening nightmare last night. Programmers started massively using languages which could not even get scoping right while others started building half-assed systems over JavaScript and HTML to badly emulate the capabilities of full-assed systems.
I fear it's actually happening.
Name:
Anonymous2013-06-27 12:58
>>7
As we realize ECMAScript/Web based applications are becoming very important and useful, ES operating system has been designed to make the Web Apps APIs as the primary operating system interfaces, and to be an extensible operating system by supporting the component technology from the operating system kernel level as originally proposed for the future direction by Noah Mendelsohn
Perl: there's more than one way to do it;
Python: there should be only one way to do a thing;
Lisp: there should be a DSL to do it;
Haskell: do what? I've papers to publish;
C/C++: segmentation fault.
And so close too! But even ignoring that:
Assume instead: (W→((X→¬Y)∧(X→Z)))∧(((X→¬Y)∧(X→Z))→W)
(W↔((X→¬Y)∧(X→Z)))
((X→¬Y)∧(X→Z)) -> (¬X∨(¬Y∧Z))
(W↔(¬X∨(¬Y∧Z)))
>>18
On the hardware level, going NAND-only makes economic sense - it's cheaper to produce ICs that only include one type of gate, and the NAND logical operation is the only one all others can be reduced to.
>>25
NOR gates are indeed functionally complete as well. Still pure NOR logic they're mostly slower than NAND logic, thus the former is less prevalent.
>>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
In 1900, in the Paris conference of the International Congress of Mathematicians, David Hilbert challenged the mathematical community with his famous Hilbert's problems, a list of 23 unsolved fundamental questions which mathematicians should attack during the coming century. The first of these, a problem of set theory, was the continuum hypothesis introduced by Cantor in 1878, and in the course of its statement Hilbert mentioned also the need to prove the well-ordering theorem.
Symmetric difference of sets A and B, denoted A △ B or A ⊖ B, is the set of all objects that are a member of exactly one of A and B (elements which are in one of the sets, but not in both). For instance, for the sets {1,2,3} and {2,3,4} , the symmetric difference set is {1,4} . It is the set difference of the union and the intersection, (A ∪ B) \ (A ∩ B) or (A \ B) ∪ (B \ A).
Name:
Anonymous2013-09-07 16:48
FSOL
Name:
Anonymous2013-09-07 16:52
>>33
Sick dubs, Franky. Did you get to meet Hilbert in Pari?