Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread M Philbrook
In article <3794b$55678d83$5419aafe$56...@news.ziggo.nl>, skybuck2000 @hotmail.com says... > > Hello, > > I was just coding and ran into a little logic problem which is as follows: > > There are two booleans/variables which can be either false or true. > > The desired thrutle table is: > > A =

Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread Chris Angelico
On Fri, May 29, 2015 at 8:53 PM, Tim Chase wrote: > On 2015-05-29 13:48, Chris Angelico wrote: >> That said, though, using 0 for False and 1 for True is easily >> the most common convention in use today, and the next most likely >> case is that comparing booleans would give a simple and immediate

Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread random832
On Thu, May 28, 2015, at 23:48, Chris Angelico wrote: > On Fri, May 29, 2015 at 1:20 PM, wrote: > > The possibility of spelling these with the comparison operators, as some > > have suggested, is a consequence of Python's implementation where True > > == 1 and False == 0. In other languages bool

Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread random832
On Thu, May 28, 2015, at 23:49, Skybuck Flying wrote: > Ok thanks for this information. > > I was just wondering how many thruth table combinations there can be for > a > typical thruth table with 2 inputs and 1 output. > > Since there are 2 inputs, this means 4 possible outputs, which means 2 t

Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread alister
On Fri, 29 May 2015 13:48:55 +1000, Chris Angelico wrote: > On Fri, May 29, 2015 at 1:20 PM, wrote: >> The possibility of spelling these with the comparison operators, as >> some have suggested, is a consequence of Python's implementation where >> True == 1 and False == 0. In other languages boo

Re: Logic problem: need better logic for desired thruth table.

2015-05-29 Thread Tim Chase
On 2015-05-29 13:48, Chris Angelico wrote: > That said, though, using 0 for False and 1 for True is easily > the most common convention in use today, and the next most likely > case is that comparing booleans would give a simple and immediate > error. So it's most likely to be safe to do. There ar

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Steven D'Aprano
On Fri, 29 May 2015 01:49 pm, Skybuck Flying wrote: > wrote in message > news:mailman.152.1432869623.5151.python-l...@python.org... > > On Thu, May 28, 2015, at 17:50, Skybuck Flying wrote: >> Surpisingly enough I don't think there is a casual/common operator for >> this >> thruth table. >> >> AN

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Laura Creighton
You may be interested in PyEda https://pypi.python.org/pypi/pyeda It is for electronic design automation. But it will minimise truth tables for you. http://pyeda.readthedocs.org/en/latest/search.html?q=truth+tables&check_keywords=yes&area=default Laura -- https://mail.python.org/mailman/listin

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Skybuck Flying
wrote in message news:mailman.152.1432869623.5151.python-l...@python.org... On Thu, May 28, 2015, at 17:50, Skybuck Flying wrote: Surpisingly enough I don't think there is a casual/common operator for this thruth table. AND does not apply. OR does not apply. XOR does not apply. " All sixteen

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Chris Angelico
On Fri, May 29, 2015 at 1:20 PM, wrote: > The possibility of spelling these with the comparison operators, as some > have suggested, is a consequence of Python's implementation where True > == 1 and False == 0. In other languages bool may not be relatable (or at > least not orderable), or False m

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread random832
On Thu, May 28, 2015, at 17:50, Skybuck Flying wrote: > Surpisingly enough I don't think there is a casual/common operator for > this > thruth table. > > AND does not apply. > OR does not apply. > XOR does not apply. All sixteen possible logical operators have formal names. This one is called "B

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
I am not so sure anymore about my conclusion, I will investigate this further tomorrow. It seems safe to conclude that at least the following operators have their own thruth tables: = <> < = <= These are the comparision operators. Assume True is greater than False allows them to be use

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Skybuck Flying
"Denis McMahon" wrote in message news:mk884e$gth$1...@dont-email.me... On Thu, 28 May 2015 14:58:19 -0700, sohcahtoa82 wrote: On Thursday, May 28, 2015 at 2:50:18 PM UTC-7, Skybuck Flying wrote: Hello, # Desired truth table for BotWaitForCooldown and CooldownDetected # BotWaitForCooldo

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
Interestingly enough the shortest I have seen so far is ***: def TestLogic( BotWaitForCooldown, CooldownDetected ): # return BotWaitForCooldown or ((not BotWaitForCooldown) and CooldownDetected) # this logic is flawed, please improve logic. # return (not ((not BotWaitForCooldown) and CooldownD

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Michael Torrie
On 05/28/2015 05:03 PM, Grant Edwards wrote: > On 2015-05-28, Grant Edwards wrote: >> On 2015-05-28, Michael Torrie wrote: >>> On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: I think the logic you're really looking for is: return BotWaitForCooldown or (not (BotWaitForCooldown

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread sohcahtoa82
On Thursday, May 28, 2015 at 3:17:10 PM UTC-7, Michael Torrie wrote: > On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: > > I think the logic you're really looking for is: > > > > return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) > > Yes this is the simplest form. F

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Denis McMahon
On Thu, 28 May 2015 14:58:19 -0700, sohcahtoa82 wrote: > On Thursday, May 28, 2015 at 2:50:18 PM UTC-7, Skybuck Flying wrote: >> Hello, >> # Desired truth table for BotWaitForCooldown and CooldownDetected >> # BotWaitForCooldown: CooldownDetected: Desired Result: >> # FalseFalse

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Paul
Skybuck Flying wrote: Hello, I was just coding and ran into a little logic problem which is as follows: There are two booleans/variables which can be either false or true. The desired thrutle table is: A = input B = input C = output A B C: --- F F T F T F T F T T T T Surpisingly enough

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Grant Edwards
On 2015-05-28, Grant Edwards wrote: > On 2015-05-28, Michael Torrie wrote: >> On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: >>> I think the logic you're really looking for is: >>> >>> return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) >> >> Yes this is the simples

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Mark Lawrence
On 28/05/2015 23:39, Lew Pitcher wrote: On Thursday May 28 2015 17:50, in comp.lang.c, "Skybuck Flying" wrote: Hello, I was just coding and ran into a little logic problem which is as follows: There are two booleans/variables which can be either false or true. The desired thrutle table is:

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Grant Edwards
On 2015-05-28, Michael Torrie wrote: > On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: >> I think the logic you're really looking for is: >> >> return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) > > Yes this is the simplest form. Not really. In old school notation

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Lew Pitcher
On Thursday May 28 2015 17:50, in comp.lang.c, "Skybuck Flying" wrote: > Hello, > > I was just coding and ran into a little logic problem which is as follows: > > There are two booleans/variables which can be either false or true. > > The desired thrutle table is: > > A = input > B = input >

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Grant Edwards
On 2015-05-28, Grant Edwards wrote: > On 2015-05-28, Skybuck Flying wrote: > >> However I can already see I am not happy with this video solution. >> >> I have 3 true outputs, and only 1 false output. >> >> That would require a lot of logic. >> >> I guess I can turn it around and negate the whole

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Michael Torrie
On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: > I think the logic you're really looking for is: > > return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) Yes this is the simplest form. For more complicated truth tables you can create a K map and then apply a reductio

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
Ok, problem solved for now, it seems: I used video tutorial method and inverted it for the false case ;) But anyway... I would not only need a "thruth table to logic/boolean operations converter" but also a "boolean operations optimizer" ;) # loop has to run if: # while DesiredResult==True: #

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Grant Edwards
On 2015-05-28, Skybuck Flying wrote: > However I can already see I am not happy with this video solution. > > I have 3 true outputs, and only 1 false output. > > That would require a lot of logic. > > I guess I can turn it around and negate the whole thing... and focus on the > false output. Do

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Grant Edwards
On 2015-05-28, Grant Edwards wrote: > On 2015-05-28, Skybuck Flying wrote: > >> I tried logic below... but funny enough it failed, now I feel like a >> noob lol and share this funny little fail logic with you. >> >> Can you improve/fix the logic ? > >> # while DesiredResult==True: >> # Desired tr

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Jussi Piitulainen
Skybuck Flying writes: > There are two booleans/variables which can be either false or true. > > The desired thrutle table is: > > A = input > B = input > C = output > > A B C: > --- > F F T > F T F > T F T > T T T That's A >= B, where True >= False: >>> BB = False, True >>> print(*((A,

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
However I can already see I am not happy with this video solution. I have 3 true outputs, and only 1 false output. That would require a lot of logic. I guess I can turn it around and negate the whole thing... and focus on the false output. Bye, Skybuck. -- https://mail.python.org/mailman

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
This is a start lol: https://www.youtube.com/watch?v=lKqTSBKmWA4 I wonder if it can be simplied... I'll give it a try. Basically it comes down to creating a logic expression for each true result in the desired output and or-ing with each other. The variables leading to the true result in the

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Grant Edwards
On 2015-05-28, Skybuck Flying wrote: > I tried logic below... but funny enough it failed, now I feel like a > noob lol and share this funny little fail logic with you. > > Can you improve/fix the logic ? > # while DesiredResult==True: > # Desired truth table for BotWaitForCooldown and CooldownDe

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread sohcahtoa82
On Thursday, May 28, 2015 at 2:50:18 PM UTC-7, Skybuck Flying wrote: > Hello, > > I was just coding and ran into a little logic problem which is as follows: > > There are two booleans/variables which can be either false or true. > > The desired thrutle table is: > > A = input > B = input > C =

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Tim Chase
On 2015-05-28 23:50, Skybuck Flying wrote: > A = input > B = input > C = output > > A B C: > --- > F F T > F T F > T F T > T T T > > Surpisingly enough I don't think there is a casual/common operator > for this thruth table. > > AND does not apply. > OR does not apply. > XOR does not apply.

Re: Logic problem: need better logic for desired thruth table. (thruth table to logic/boolean operations generator sought/needed)

2015-05-28 Thread Skybuck Flying
I think I have run into this problem before... but solved it with some seperate if statements. However in this case/this time I would like to not solve it with if statements, but simply and/or/not/xor, in other words, boolean operators. So what would help is a "thruth table to logic" converto

Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Skybuck Flying
Hello, I was just coding and ran into a little logic problem which is as follows: There are two booleans/variables which can be either false or true. The desired thrutle table is: A = input B = input C = output A B C: --- F F T F T F T F T T T T Surpisingly enough I don't think there is