This week's giveaway is in the Spring forum.We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!

# Working unless Not Working

Jules Bach
Ranch Hand
Posts: 71

I’m not sure if there are any propositional logic buffs out there…but, something that is nagging me…

(1) “P unless Q”

Where P and Q represent propositional variables…

Now, I’m not sure why – but it seems that the above sentence in quotes is considered the same as this sentence.

(2) “P or Q”

(At least this site on logic seems to suggest so)

Maybe P represents “I am working”, and Q represents “I am wasting time on meaningless drivel”..

Sentence (1) suggests that I can’t be doing both, Sentence (2) however suggests to be that I can be doing both…

Are (1) and (2) the same in terms of Propositional Logic?
Can I be working and use meaningless drivel?

Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Jules,

Are you sure you want to post this in Meaningless Drivel? Would you rather have somebody move it to some other place like say programming diversions? If yes, just holler will ya?

Jules Bach
Ranch Hand
Posts: 71
Ah yes...maybe there was too much meaning in all of that.

thanks Maneesh - can it be moved to programming diversions?

Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Jules Bach wrote:
thanks Maneesh - can it be moved to programming diversions?

Done.

fred rosenberger
lowercase baba
Bartender
Posts: 12083
29
I didn't look at the page you linked to, but i would say that 1 and 2 are NOT the same thing. In my mind, 1 would be more like

2a) if Q then not P

going back and pondering some more...i'm not sure anymore. I think it sort of depends on what definition of "OR" you are using. By boolean logic, OR means one or both are true.

but generally in conversation, OR means a choice - you can have either one, but not both. If I present you with a piece of cake and a piece of pie and tell you "you can have cake or pie", most people would know that you can't have both, but must choose one of the two.

So, "I am working or I am on MD". in english, i think it means one or the other. boolean would mean both could be true - i.e. if I were a paid employee of the javaranch.

Garrett Rowe
Ranch Hand
Posts: 1296
I tend to agree with Fred's original response to this. I think the `unless` implies exclusivity. More formally, I think the following truth table is implied:

Steve Luke
Bartender
Posts: 4181
21
I would tend to agree with Garrett, they are not equivalent. I think if (2) were written as:
(2) “either P or Q"
Then the two statements would be the same.

Henry Wong
author
Marshal
Posts: 20880
75
Garrett Rowe wrote:I tend to agree with Fred's original response to this. I think the `unless` implies exclusivity. More formally, I think the following truth table is implied:

IMO, I don't think a full truth table can be implied. P unless Q states that P will definitely happen unless Q happens, but if Q does happen, I don't think you can imply anything else -- meaning...

And... it has been a long while since I worked with any algorithm that needed fuzzy logic, so I could be remembering wrong here...

Henry