Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 25, 2024, 8:07 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inclusive OR? Wtf?
#1
Inclusive OR? Wtf?
I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.
My ignore list




"The lord doesn't work in mysterious ways, but in ways that are indistinguishable from his nonexistence."
-- George Yorgo Veenhuyzen quoted by John W. Loftus in The End of Christianity (p. 103).
Reply
#2
RE: Inclusive OR? Wtf?
(May 29, 2014 at 1:06 pm)Tea Earl Grey Hot Wrote: I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.
In computers, there are usually 3 logic operators: OR, NOT, AND. There's also the bitwise operator, XOR, which is what you are talking about.

I think the way they have it makes sense. A girl will go out with a man if he has a sexy body or a lot of money. Saying she will also go out with him if he has a sexy body AND a lot of money seems a little too redundant. Smile
Reply
#3
RE: Inclusive OR? Wtf?
(May 29, 2014 at 1:06 pm)Tea Earl Grey Hot Wrote: I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.

I don't see the problem. I'm more experienced in programming logic and OR's usage is quite necessary, so lemme give you an example.


Let's say on a social networking site, I want the login/user system to distinguish Admins and Moderators from normal users, so as to allow entry to certain parts of the site only for the Admins and Mods. Well, one easy way I could do this is to only allow entry to the site if the user's row in the database has its user type set to either "admin" or "mod":

Quote:<?php

$usertype = $row['usertype'];

if($usertype === 'admin' || 'mod'){
// Do shit
}
else{ header('Location: home.php'); } // kick 'em to another file

?>

Using OR here allows me to set the parameters which to check for, though it's not the only.
"The reason things will never get better is because people keep electing these rich cocksuckers who don't give a shit about you."
-George Carlin
Reply
#4
RE: Inclusive OR? Wtf?
(May 29, 2014 at 1:06 pm)Tea Earl Grey Hot Wrote: I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.

It greatly simplifies things to have two different operators for OR and XOR. Otherwise, the nonexclusive OR would have to be written as " if (a or b) or (a and b)". In my experience, the nonexclusive OR is much more commonly used.

In computer languages, the lack of a non-exclusive or would also make some operations less optimal - something like:

if (null == s || s.equals("")) {
// some operation
}


Would be extremely cumbersome to write as a single check. You'd have to do something like this to make it's meaning apparent:

if (null == s) {
// some operation
} else if s.equals("") {
// same operation
}

There's no straightforward way to code it using a nonexclusive or without the code throwing a null pointer exception.
Reply
#5
RE: Inclusive OR? Wtf?
(May 29, 2014 at 2:05 pm)Cthulhu Dreaming Wrote:
(May 29, 2014 at 1:06 pm)Tea Earl Grey Hot Wrote: I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.

It greatly simplifies things to have two different operators for OR and XOR. Otherwise, the nonexclusive OR would have to be written as " if (a or b) or (a and b)". In my experience, the nonexclusive OR is much more commonly used.
In propositional logic, you actually have to write "(a or b) and not (a and b)" to mean exclusive or. There's no symbol for it.

Quote:“(P v Q)” claims that at least one part is true. So “I went to Paris or I went to Quebec” is true just if I went to one or both places. Our “v” symbolizes the inclusive sense of “or”; English also can use “or” in an exclusive sense, which claims that at least one part is true but not both. Both senses of “or” can translate into our symbolism:
• Inclusive “or”: A or B or both = (A v B)
• Exclusive “or”: A or B but not both = ((A v B) · ~(A · B))”

Excerpt From: Harry J. Gensler. “Introduction to Logic: Second Edition.” iBooks. https://itunes.apple.com/WebObjects/MZSt...=495640131
My ignore list




"The lord doesn't work in mysterious ways, but in ways that are indistinguishable from his nonexistence."
-- George Yorgo Veenhuyzen quoted by John W. Loftus in The End of Christianity (p. 103).
Reply
#6
RE: Inclusive OR? Wtf?
(May 29, 2014 at 2:11 pm)Tea Earl Grey Hot Wrote: In propositional logic, you actually have to write "(a or b) and not (a and b)" to mean exclusive or. There's no symbol for it.

Quote:“(P v Q)” claims that at least one part is true. So “I went to Paris or I went to Quebec” is true just if I went to one or both places. Our “v” symbolizes the inclusive sense of “or”; English also can use “or” in an exclusive sense, which claims that at least one part is true but not both. Both senses of “or” can translate into our symbolism:
• Inclusive “or”: A or B or both = (A v B)
• Exclusive “or”: A or B but not both = ((A v B) · ~(A · B))”

Excerpt From: Harry J. Gensler. “Introduction to Logic: Second Edition.” iBooks. https://itunes.apple.com/WebObjects/MZSt...=495640131

Formal propositional logic isn't my thing, but programming is - the above is precisely why I'm glad we have separate operators for the two classes of OR in programming languages.

It is inconvenient that the meaning is different from ordinary English usage, but that's not all that unexpected - it's not uncommon to find that words take more specific meanings in specialized disciplines (compare the common and scientific use of "theory", for example).
Reply
#7
RE: Inclusive OR? Wtf?
(May 29, 2014 at 1:18 pm)bennyboy Wrote:
(May 29, 2014 at 1:06 pm)Tea Earl Grey Hot Wrote: I'm studying propositional logic and I learned that "or" means "at least one is true". So you could have "a or b" and even if both a and b were each true then "a or b" is still true. In everyday language however "or" means only one of two things can be true, not both hence the reason we have the phrase "and/or" to mean "at least one is true".

Why not just keep the traditional exclusive meaning of "or" in propositional logic and then have another symbol for "and/or"? Seems simpler to me.
In computers, there are usually 3 logic operators: OR, NOT, AND. There's also the bitwise operator, XOR, which is what you are talking about.

I think the way they have it makes sense. A girl will go out with a man if he has a sexy body or a lot of money. Saying she will also go out with him if he has a sexy body AND a lot of money seems a little too redundant. Smile

There's also technically NAND and NOR, which are inverted, and XNOR, which is also inverted. Also, there's technically the ON and OFF gates which are always on or off, respectively.
Reply
#8
RE: Inclusive OR? Wtf?
Here I had been thinking to myself that it would be better for me to go after a degree in psychology rather than a degree in computer engineering, however the thought of designing logic circuits excites me. Back when I was in school, most logic assemblies were built out of NAND gates, as that was the simplest and most cost-efficient gate / transistor design. Maybe that's changed, I don't know.
[Image: extraordinarywoo-sig.jpg]
Reply
#9
RE: Inclusive OR? Wtf?
(June 4, 2014 at 3:24 pm)rasetsu Wrote: Here I had been thinking to myself that it would be better for me to go after a degree in psychology rather than a degree in computer engineering, however the thought of designing logic circuits excites me. Back when I was in school, most logic assemblies were built out of NAND gates, as that was the simplest and most cost-efficient gate / transistor design. Maybe that's changed, I don't know.

Ever played the game called Robot Oddyssey?

It's for the Apple IIe, and you can get it with an emulator. In this game, you have to design robots to take in more-and-more complex inputs from their environment, and produce puzzle-solving behaviors using the logic gates. Best game ever.
Reply





Users browsing this thread: 1 Guest(s)