aspose file tools*
The moose likes Programming Diversions and the fly likes Working unless Not Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Working unless Not Working" Watch "Working unless Not Working" New topic
Author

Working unless Not Working

Jules Bach
Ranch Hand

Joined: Apr 28, 2008
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

Joined: Jul 26, 2007
Posts: 10375
    
    8

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?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jules Bach
Ranch Hand

Joined: Apr 28, 2008
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

Joined: Jul 26, 2007
Posts: 10375
    
    8

Jules Bach wrote:
thanks Maneesh - can it be moved to programming diversions?


Done.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11314
    
  16

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

[edit]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.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
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:



Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Steve Luke
Bartender

Joined: Jan 28, 2003
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.


Steve
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18837
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Working unless Not Working