Speakpigeon
Valued Senior Member
Anyone talks Python?
So, someone posted a link to a bit of code in Python purporting that it falsified the Law of Identity.
That's here if you're interested: https://repl.it/repls/SuperficialShimmeringAnimatronics.
The Law of Identity is one of the three laws considered as the foundation of Aristotelian logic. As such, it is crucial to the conventional view of logic whereby illogical is regarded as synonymous with meaningless and nonsensical.
I'm not here to discuss the Law of Identity, so if someone is interested, please start a thread in the philosophy forum.
Instead, can anyone explain the principle of the algorithm?
So, here is the code:
Here is also the blurb to explain the motivation behind the code...
EB
Python (programming language)
Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace. It provides constructs that enable clear programming on both small and large scales. Van Rossum led the language community until stepping down as leader in July 2018.
Python features a dynamic type system and automatic memory management. It supports multiple programming paradigms, including object-oriented, imperative, functional and procedural, and has a large and comprehensive standard library.
Python interpreters are available for many operating systems. CPython, the reference implementation of Python, is open source software and has a community-based development model, as do nearly all of Python's other implementations. Python and CPython are managed by the non-profit Python Software Foundation.
https://en.wikipedia.org/wiki/Python...ming_language)
So, someone posted a link to a bit of code in Python purporting that it falsified the Law of Identity.
That's here if you're interested: https://repl.it/repls/SuperficialShimmeringAnimatronics.
The Law of Identity is one of the three laws considered as the foundation of Aristotelian logic. As such, it is crucial to the conventional view of logic whereby illogical is regarded as synonymous with meaningless and nonsensical.
I'm not here to discuss the Law of Identity, so if someone is interested, please start a thread in the philosophy forum.
Instead, can anyone explain the principle of the algorithm?
So, here is the code:
It doesn't seem too complicated, but I'm a complete ignoramus about Python and the guy seems incapable of explaining himself...class Aristotelian(object):
def __init__(self):
pass
A = Aristotelian()
print("Law of Identity: A = A => {}".format(A == A))
class Human(object):
def __init__(self):
pass
def __eq__(self, other):
return False
A = Human()
print("Law of Humanity: A = A => {}".format(A == A))
Here is also the blurb to explain the motivation behind the code...
Thanks,# The law of identity is the cornerstone of Arostotelian/Classical logic.
# A = A is True.
# In the 2nd half of the 20th century the American mathematician Haskell Curry and logician William Alvin Howard discovered an analogy between logical proofs and working computer programs.
# This is known as the Curry-Howard correspondence.
# Mathematical proofs are working computer programs.
# https://en.wikipedia.org/wiki/Curry%...correspondence
# Therefore, if we can write a working computer program which asserts that A = A is false we have living proof that founding axiom of Aristotelian logic is a mistake.
# I hereby reject the Aristotelian religion and I embrace Lambda calculus.
EB