ID:120779
 
Not a bug
BYOND Version:493
Operating System:Windows 7 Ultimate
Web Browser:Firefox 7.0.1
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Not sure if this is a huge issue, but it is definitely annoying.

!== and != return different results, I'll explain better with an example:

For the example A=1 and B=2

if(A==B)  //returns false

if(A!=B) // returns true

if(!A==B) // returns false


In the third example the ! operator is used to check if A is equal to B. It should return true, because although A is not equal to B (resulting in a false) the ! operator should switch the result to true in a similar way that a negative will turn another negative into a positive.

Once again, I'm not sure if it's a bug or just something that was never planned in the first place, but "not false" should always equate to "true" in this case, it doesn't.

DM may be reading this as: if not A equals B. Then the statement is disregarding that "not A" can be any value except for "A", including B which would result in a true as well.
You forgot about operator precedence.

!A==B is the same as (!A)==B. If you want equivalence to !=, you need !(A==B).
That's understandable but doesn't (!A) mean "not A"? since B isn't A then !A==B should return true as well.

Unless the ! operator isn't handled as a "not" when used before a statement.
Think about what you're saying. !A does not mean "anything that isn't A". In a computer language, every operation has to produce a consistent result. It's true that 2 is a value that isn't 1, but so is "blue" and null and usr.

The not operator always returns 1 or 0. If the value it's operating on is true, it returns 0; otherwise 1.
I see what you mean now, I was under the impression that !A would be recognized as an open variable rather than a consistent value. Computer Logic vs. Human Logic
Human logic says the same thing the computer logic does; by your model, !A==B is always inconclusive. The only thing close to your line of reasoning is set theory, where you could say if(B in !A), but set theory is a million miles from regular procedural logic.
Lummox JR wrote:
Human logic says the same thing the computer logic does; by your model, !A==B is always inconclusive. The only thing close to your line of reasoning is set theory, where you could say if(B in !A), but set theory is a million miles from regular procedural logic.

Human logic would say that "not A" is anything but A. It doesn't make it inconclusive it just makes it an open variable. Just like if someone asks "What kind of car do you want?" I can say "Not a truck" and they can still provide an answer to that, one possibility being: "Here's a hatchback."

It's similar to when you use <> for inequality in numbers A<>B means that A could be any number BUT B or vice-versa, where B can be any number BUT A.
<> means the exact same thing as !=; they actually parse as the same operator. It just says the two values are not equal.

Logically, !A==B and A!=B are not equivalent even under set theory. That's like saying "Whatever is not a duck is a squirrel." Clearly that's incorrect. You can say "Something that is not a duck might be a squirrel," which would be (B in !A).

But still, that type of logic doesn't even apply because it's set theory. Any logic that says something like "All P are Q" is just set theory. That's not in play. Also the ! operator is not a set operator; it is a boolean operator, with a consistent result of either 1 or 0.

The gist is, even if you don't account for ! being a boolean operator, your equivalence is still incorrect under set theory as well.
I'm not talking about set theory. I gave you a perfect example of !A as in "Not a Truck" it doesn't mean that I'm equating !A to be anything, I'm saying that !A is the equivalent of an open variable in human logic.


Logically, !A==B and A!=B are not equivalent. That's like saying "Whatever is not a duck is a squirrel." Clearly that's incorrect. You can say "Something that is not a duck might be a squirrel," which would be (B in !A).

By saying this, you implied that I am saying that !A MUST have a definitive value, when I had said that it's an open variable which is what you meant by:

You can say "Something that is not a duck might be a squirrel," which would be (B in !A).

I never said anything along those lines in my example either,

if someone asks "What kind of car do you want?" I can say "Not a truck" and they can still provide an answer to that, one possibility being: "Here's a hatchback."


Now if I had said "You don't want a truck? Then you want a hatchback". Then you would be correct in assuming that I'm equating a distinct value to an open variable, when I hadn't

As for the <> operator. <> means "less than or greater than" in Human logic, in which case <>A is the same as !A which is: Anything BUT A. Unless you mean to tell me that <>4 doesn't mean "Anything higher than or lower than 4, but NOT 4."

Once again, this is all under the assumption that we're talking about human logic.

I don't know anyone who says that "Not A" can't mean "B". I know it isn't definitively B but it COULD be "B". Never once did I say it HAS to be B. The fact that it COULD be B makes the statement true, which is the exact opposite of what DM results in. I don't care if it's computer logic, I'm just trying to explain to you how I thought it would work, because I'm not a machine.
Bravo1 wrote:
I'm not talking about set theory. I gave you a perfect example of !A as in "Not a Truck" it doesn't mean that I'm equating !A to be anything, I'm saying that !A is the equivalent of an open variable in human logic.

The whole conccept of "open variable" is set theory. You are defining "not A" as "anything that is not A". But whether you call it regular human logic or set theory, saying !A==B is equivalent to A!=B is still wrong.

Logically, !A==B and A!=B are not equivalent. That's like saying "Whatever is not a duck is a squirrel." Clearly that's incorrect. You can say "Something that is not a duck might be a squirrel," which would be (B in !A).

By saying this, you implied that I am saying that !A MUST have a definitive value, when I had said that it's an open variable which is what you meant by:

No, I'm saying if you define "not A" to mean "anything that isn't A" or even "something that isn't A", then it is not equivalent to A!=B because the statement is not true or false under the same conditions.

You can say "Something that is not a duck might be a squirrel," which would be (B in !A).

I never said anything along those lines in my example either,

You said the might-be part; that's the gist of your argument. See below.

if someone asks "What kind of car do you want?" I can say "Not a truck" and they can still provide an answer to that, one possibility being: "Here's a hatchback."

Now if I had said "You don't want a truck? Then you want a hatchback". Then you would be correct in assuming that I'm equating a distinct value to an open variable, when I hadn't

That's back to set theory. Hatchbacks are a subset of cars, cars and trucks both subsets of vehicles.

As for the <> operator. <> means "less than or greater than" in Human logic, in which case <>A is the same as !A which is: Anything BUT A. Unless you mean to tell me that <>4 doesn't mean "Anything higher than or lower than 4, but NOT 4."

The <> and != operators are binary, not unary; therefore there is no such thing as <>4 by itself. And while I agree that under a strict interpretation of the symbols, <> makes sense only numerically, the truth is the operator in that form doesn't exist outside of programming languages. It is intended to be equivalent to ≠.

Again, you're still thinking in set theory. Call it whatever you want, that's what it is. It is not applicable to this situation, and your reasoning is thrown off because of it. But that's not even the key problem, which is this:

I don't know anyone who says that "Not A" can't mean "B". I know it isn't definitively B but it COULD be "B". Never once did I say it HAS to be B. The fact that it COULD be B makes the statement true, which is the exact opposite of what DM results in. I don't care if it's computer logic, I'm just trying to explain to you how I thought it would work, because I'm not a machine.

Equals and "might equal" are not the same thing, and that, as I tried to explain, is the key point where your argument falls apart. It is possible to phrase the "might equal" statement in actual set operators, such as (B in not A).

The error you made is conflating equality with the possibility of equality, which is not the same thing under any system of logic--formal or otherwise.
The error you made is conflating equality with the possibility of equality, which is not the same thing under any system of logic--formal or otherwise.

I'm not going to read the rest, because once again, you're stating the exact opposite of what I'm explaining to you.

Once again, I have never said that !A is equal to B. I am merely stating that no matter what you cannot say, in HUMAN LOGIC, that !A==B is False. Because although it's not true, it is also not false.

Please, for the love of all that is logical, stop saying that I am equating a definitive value to !A. I am not doing that, I never would do that. I am only saying that it is "not false" when it's returning false. I know that byond needs a definite answer, because it's computer logic, it needs true or false, and it is safer to return "false" I understand that, I agree with you. I AGREE WITH YOU. But please, understand that to people, to humans, there is such a thing as "not false" because it is, as I've said it a few times before an open variable.
And again, open variable means set theory. Again, the bigger deal is that you're still conflating equality with possible equality.

There is no such thing as a "maybe true" statement in any form of logic. For a statement to be true, it has to be true in all cases. If you make a statement and its truth value depends on the cases, then the statement as a whole is false. Where you're getting hung up is that the statement isn't where you thought it was. You thought that "A equals B" could be the statement and "maybe" would just be a modifier, but "maybe (A equals B)" is not a statement because it can't stand on its own. In actual fact, "maybe" modifies the operator. The statement is "A (maybe equals) B".

All this really is "human logic". When you say "equals" you're not saying "might equal", because they're two different phrases with significantly different meaning. Likewise in any system of formalized logic, they'd be represented by two different operators because they mean different things.

Informal: A and B are the same.
Formal: A == B

Informal: A and B might be the same.
Formal: B in set(A)
Formal: A in set(B)

This is not machine logic. This is regular old basic logic, human logic, and I'm showing it in both forms just to point out that whether you're using an operator or words, it's the same thing. As soon as you stuck "could" into the statement, you changed its meaning in a fundamental way.

So indeed, you can say in human logic--which is just plain logic--that (not A)==B is false because that's a "hard" equality. The statement is a generalization, and a generalization is false if any of the cases are false. (Generalizations may make good heuristics, although this one wouldn't.)
Okay, how bout this, I'm just going to explain with some mathematical aids then

A=1
B=2

!A==B

!1==2

machine logic: not 1 == 2

Okay, we'll stop here for now. This is where the problem occurs between you and I.

You say this is false.

I agree with you.

I am not arguing against this.

What I am saying is, to people, if I say "Not a car" you could say "Banana" and you would be correct. That is all that I'm saying, and that is what I said I had originally perceived this issue to be.

I originally thought, when I had made this post, that this was the result of an inequality. However, after your inital explanation, you cleared it up and presented it to me that this is in fact, and equality.

I then proceeded to tell you "Oh, at first, it looked like an inequality"

To which you responded with along the lines of "an inequality will return false"

!A==B and A!=B are not equivalent even under set theory

It doesn't matter whether or not it's set theory, in any theory, these two questions are not the same, one is an equality, the other is an inequality.

The confusion seems to have popped up right here.

You're under the impression that I believe !A==B is an inequality.

I am saying "I thought it was an inequality at first, but you cleared that up, had this actually been an inequality, it would have result as true".

Which it would have: A!=B is true, that is all I' m trying to say. Then you started to start explaining set logic, I keep trying to explain to you that I'm not referring to set logic, I'm referring to inequalities, in which case, it would be true. Yet you've continue to explain about equalities and set logic.

Human logic is based on inequalities, why? because there is no possible way for one person to know all the information in the known universe. No one can say "It WILL rain today" because there is always a possibility that it wont, resulting in an inequality, a case in which a definitive answer is possible, but never known.

So, You are correct that !A==B is false, there is no issue there. The issue is that, Human Logic is not the same as Machine logic because human logic deals with inequalities more often than machine logic does, as machine logic relies greatly on equalities.

Human logic says the same thing the computer logic does

In this specific case, YES. I agree with you, however Human logic does not pertain to this case every time. That's why I gave the example of someone buying "Not a Truck" because it's an inequality.

I really hope this cleared things up and I really hope you stop trying to throw the logic of quality at me when I'm referring entirely to inequalities, like I have been this entire time.
Down to the meat of it:

You said originally said that if A!=B, then !A==B should be true based on the fact that you thought !A should be "open" (i.e., a set). That is, you said: "If A!=B, then !A==B." By regular old logic, that's a false statement because the conclusion (!A==B) isn't always true when the hypothesis (A==B) is. The only way for your if-then statement to work is in the realm of boolean values, where A and B are strictly true or false, and not-A is just the opposite of A.

Again, that's not program code, just regular logic. I'm dipping a little into formality there, but that's because it's impossible to discuss the topic at all without doing so.

Honestly though, it's become clear to me that discussing this further isn't going to get anywhere regardless. You're playing too fast and loose with semantics and it's just confusing you. I would strongly recommend doing some research into formal logic (which really isn't any different from informal logic; it just uses symbols) so we're at least on the same page. You seem to think that by my constantly bringing up the difference between boolean and set logic, I'm trying to drag this back into the programming sphere; I am not. There is a distinction that's relevant to this discussion, but right now we're not even speaking the same language.
I explained the issue and that I agreed with you but instead of saying "Oh I see, you were confused at first and we misunderstood each other. I unde3rstand now and I see no issue here" you went ahead and decided to insult me by saying I need to read up.

the fact that you thought !A should be "open" (i.e., a set).

I was never talking about a set. Once again, you misunderstood me. Just because I use the word "open" does not mean I'm talking about sets.

Again, that's not program code, just regular logic.

Again, I'm not talking about program code, I WAS talking about regular logic, so then, how was I wrong if we were both talking about the same thing? I guess you misunderstood me there too.

You're playing too fast and loose with semantics and it's just confusing you.

We're not discussing the study of meaning here. We're discussing the difference between equalities and inequalities. We never jumped into semantics so I guess you're misunderstanding there as well.

I would strongly recommend doing some research into formal logic (which really isn't any different from informal logic; it just uses symbols) so we're at least on the same page

I originally thought that !A==B would equate to A!=B or A<>B, you corrected me, I agreed. I then stated I thought we were talking about inequalities (i.e. <>, !=, >=, <=, >, <) so you decided to start discussing equalities with me (==). So I don't understand how I was the one being misinterpreted when I was discussing inequalities and I told you several times I was referring to inequalities and instead you continue to drove on about how my statements would not fit am equation, it doesn't matter what you said because you were misunderstanding what I was saying.

You seem to think that by my constantly bringing up the difference between boolean and set logic, I'm trying to drag this back into the programming sphere; I am not. There is a distinction that's relevant to this discussion, but right now we're not even speaking the same language.

I never said you were, you're referring to equalities and I'm referring to inequalities but instead of recognizing the difference you continued on about it.

There is a distinction that's relevant to this discussion, but right now we're not even speaking the same language.

You're right because I'm talking about the difference of two things and you're trying to explain set logic to me. I don't give a damn about set logic as we were never talking about it in the first place, but you seem so absolutely adamant to try to explain set logic to me. Guess what? I don't care, this entire issue was NEVER about set logic, so drop it.

Honestly though, it's become clear to me that discussing this further isn't going to get anywhere regardless.

Then why do you continue to insist that I don't know what I'm talking about when you wont even recognize that we were misunderstanding each other and talking about TWO COMPLETELY DIFFERENT THINGS.
You know what, before any more of this goes on, let's just agree on the actual reason the bug was brought up.

I thought it would result in an inequality rather than being a definitive of true or false.

You corrected me and explained why, I agreed with you.

Anything after that is just pointless bull-crap arguing over misunderstandings that no one has to read. I misunderstood you, you misunderstood me, at this point, it doesn't matter. If you'd like to remove all the posts or the entire bug report then you may. I just don't want this to continue getting out of hand.

You were talking about sets, but just not using the word. This would be clear to you if you had more grounding in the subject of logic. I don't mean this to sound condescending, but you're arguing yourself into a hole on a subject you don't understand. (That goes double for semantics; we jumped into that when you started making up terms like "human logic". Muddying the teminological waters did not help your cause.)
Although you thought I was referring to sets, I was referring to inequalities. I'm not saying you're wrong, I'm only saying that we're talking about two different things.

I looked into set logic as you had suggested, and that was not what I was talking about. It may have sounded as if I was referring to sets, but I corrected myself.

This should no longer be a misunderstanding, please stop pretending like there's an issue.

I will no longer reply to your posts on this subject.