A = Time.now
A != Time.now
A == A
Just because Time.now looks like the same symbol it is not as it is an impure function that never returns the same result. A = Time.now
A != Time.now
A == A
Just because Time.now looks like the same symbol it is not as it is an impure function that never returns the same result. [1] pry(main)> eval("a != a")
NameError: undefined local variable or method `a' for main:Object from (pry):1:in `eval'
[2] pry(main)> eval("Time.now != Time.now")
=> true
I am not assigning the function to a variable - I am lazy-evaluating it.It's not equivocation because [2] is expressed exactly the same way in English. Now is not now. It is trivially true.
When I use a word, Humpty Dumpty said in rather a scornful tone, it means just what I choose it to mean — neither more nor less
While the syntax is "now", what you're really saying is now(Ti) for some i.
So the sentence, in both natural language and most programming languages becomes:
now(T0) != now(T1)
Which is easier to understand, with all arguments made explicit.Now, some "clever" programming language might automatically translate this from
now != now
To a := now(T0)
a != a
Which will be surprising to the programmer in most cases (but might be what's desired in others).The important thing is that "now" is not a comstant, but a function.
f() != f()
A != A
You seem to be agreeing with me but your response to me starts with the English phrase "I disagree".So "now" is a trickery to hide the fact you're really saying "now(Ti)", for varying i.
I'm not tripping over syntax, but I think you are:
You think you're saying
A != A
When you're really saying A1 != A2
(Or rather now(t0) != now(t1)
)And of course the second form is unsurprising.
The function I am talking about doesn't take any arguments.
[1] pry(main)> Time.now(1)
ArgumentError: wrong number of arguments (given 1, expected 0)All impure functions have an implicit dependency on (some subset of) the state of the universe when they execute; in mathematics and logic something with this kind of dependency is typically noted by parameterizing it by time when the actual precise nature of the dependency is outside of the scope of the immediate analysis (because a dependency on the state of the universe at the time of execution is equivalent to a dependency on the time of execution with a hidden function mapping time to state of the universe.)
That impure functions methods are in many programming languages syntactically not distinguished from pure ones does not change the logic here.
That Time.now(at time t0) is distinct from Time.now(at time t1) is... unsurprising, and not an example of A != A in logical terms.
Parameters ARE inputs. Results ARE outputs. Renaming them to something else is just obscuring the fact that you are still talking about a function with side-effects.
So using Python as my model of computation this is a pure function, but it does nothing:
def f(): pass
This is NOT a pure function. It has outputs. def g(): return True
This is NOT a pure function. It mandates input. def h(x): pass
This is NOT a pure function - it mandates input and produces output: def j(x): return x
This is a pure function. It calculates the answer to 2+2, but doesn't tell you what it is. def k(): 2+2
If pure functions take no input and produce no output, what is there left to analyse? What is Logic and Mathematics talking ABOUT?You only want to talk about pure functions. I want to talk about ALL functions.
So lets define the function "pure" such that
pure(f) -> True when f is a pure function
pure(g) -> False when g is an impure function
What would you say is the truth-value of pure(pure) ?> "All impure functions have an implicit dependency on (some subset of) the state of the universe when they execute"
You wrote:
> "You only want to talk about pure functions. I want to talk about ALL functions."
Find the error.
In [1]: class A:
...: def __eq__(self, other):
...: return False
...:
In [2]: a = A()
In [3]: assert a != a
In [4]: assert a == a
AssertionError
Will you now permit me to speak freely about A != A without you moralising about my reasoning?Will you now recognise my right to free speech and free thought, or must I fall in line?
Still waiting for you to implement equal() as a "pure" function.
We can discuss what you mean by "error" once we have a referent (that's not just in your head) to talk about.
Tell us more! I didn't believe in omniscience until now.
Time.now(t1) and Time.now(t2) is meaningless in this context because t1 and t2 are unbound variables. What are you passing to your function? Where is it coming from?
My function says you are overlooking something.
[1] pry(main)> Time.now(t1)
NameError: undefined local variable or method `t1' for main:Object from (pry):1:in `__pry__'
[2] pry(main)> Time.now(1)
ArgumentError: wrong number of arguments (given 1, expected 0) from (pry):2:in `now'As for the rest: please provide the implementation of your Time.now function and I'll tell you its implicit parameters. If you're not talking about an actual function that can be run by a computer, then please tell me so and I'll drop it -- I'm not interested in hypothetical functions tautologically defined not to be equal to themselves.
You are missing the point about extensional and intensional properties of functions.
If you want to look "inside" my Time.now function then maybe you should also look "inside" your equality function and find its implicit parameters?
Here's some Python boiler plate - implement equality and make the assertions pass.
def f():
return 1
def equal(x,y):
# Implement equality
assert not equal(1,2)
assert equal(1,1)
assert equal(f, f)
>If you're not talking about an actual function that can be run by a computerAs far as I can tell you are not talking about such a function either when you speak about equality, but I'll reserve judgment until you produce an implementation.
>I'm not interested in hypothetical functions tautologically defined not to be equal to themselves.
OK, but you are interested in hypothetical functions tautologically defined to be equal to themselves.
That's perfectly fine - we are interested in different tautologies.
You want to say equal(f,f) is true.
I want to say not equal(f,f) is true.
We want to say different things.
The expression A = A can be trivially re-written in another notation as equal(A,A). The reason you don't question the implementation of the equal() function is because it's declared as being true however it's implemented.
So, I declare f() != f() as being true. I also declare that f() takes no arguments. All I am doing is translating (transpiling?) English into Ruby.
"Now is not now" => "Time.now != Time.now"
Talking about function arguments is not even in point. What's the argument to now() in English?
Incorrectly.
> "Now is not now" => "Time.now != Time.now"
Sure, “Now (pointedly looks at watch) is not now (pointedly looks at watch)” is true, and the equivalent of the Ruby. Ruby expressions lack the implicit simultaneity that English sentences wthout some contextual signal of explicit time dependency have, and your mistranslation ignores this.
The English and Ruby terms map 1:1.
Now(Time.now) is not(!=) Now (Time.now)
Why do you call the correct "incorrect"?
Nowhere; that's the contextual signal that defeats the implicit simultaneity the English sentence would have without that body language.
The English sentence "Now is not Now" describes my thought process (1st person view), not my body language (3rd person view).
My thought process occurs over time. Exactly like the Ruby process.