Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91421 > unrolled thread

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

Started byrandom832@fastmail.us
First post2015-05-28 23:20 -0400
Last post2015-05-29 08:12 -0400
Articles 5 — 4 participants

Back to article view | Back to comp.lang.python


Contents

  Re: Logic problem: need better logic for desired thruth table. random832@fastmail.us - 2015-05-28 23:20 -0400
    Re: Logic problem: need better logic for desired thruth table. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-05-29 05:49 +0200
      Re: Logic problem: need better logic for desired thruth table. Laura Creighton <lac@openend.se> - 2015-05-29 06:44 +0200
      Re: Logic problem: need better logic for desired thruth table. Steven D'Aprano <steve@pearwood.info> - 2015-05-29 16:00 +1000
      Re: Logic problem: need better logic for desired thruth table. random832@fastmail.us - 2015-05-29 08:12 -0400

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

Fromrandom832@fastmail.us
Date2015-05-28 23:20 -0400
SubjectRe: Logic problem: need better logic for desired thruth table.
Message-ID<mailman.152.1432869623.5151.python-list@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 possible logical operators have formal names. This one is
called "B implies A". It can be implemented, as others have mentioned
with "A or not B".

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 may be == -1.

[toc] | [next] | [standalone]


#91425

From"Skybuck Flying" <skybuck2000@hotmail.com>
Date2015-05-29 05:49 +0200
Message-ID<a30da$5567e1b6$5419aafe$6950@news.ziggo.nl>
In reply to#91421
wrote in message news:mailman.152.1432869623.5151.python-list@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 possible logical operators have formal names. This one is
called "B implies A". It can be implemented, as others have mentioned
with "A or not B".
"

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 to 
the power of 4 different thruth tables possible, which is indeed 16.

Perhaps you have a link to all possible 16 thruth tables and their formal 
names ? That would help !

Bye,
  Skybuck. 

[toc] | [prev] | [next] | [standalone]


#91426

FromLaura Creighton <lac@openend.se>
Date2015-05-29 06:44 +0200
Message-ID<mailman.155.1432874692.5151.python-list@python.org>
In reply to#91425
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

[toc] | [prev] | [next] | [standalone]


#91429

FromSteven D'Aprano <steve@pearwood.info>
Date2015-05-29 16:00 +1000
Message-ID<55680061$0$12995$c3e8da3$5496439d@news.astraweb.com>
In reply to#91425
On Fri, 29 May 2015 01:49 pm, Skybuck Flying wrote:

> wrote in message
> news:mailman.152.1432869623.5151.python-list@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 possible logical operators have formal names. This one is
> called "B implies A". It can be implemented, as others have mentioned
> with "A or not B".
> "
> 
> 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.

The word is TRUTH not THRUTH. I don't know if you're a native English
speaker, but "thruth" sounds like the name of a bird (thrush) spoken with a
lisp.

> Since there are 2 inputs, this means 4 possible outputs, which means 2 to
> the power of 4 different thruth tables possible, which is indeed 16.
> 
> Perhaps you have a link to all possible 16 thruth tables and their formal
> names ? That would help !

http://en.wikipedia.org/wiki/Truth_table




-- 
Steven

[toc] | [prev] | [next] | [standalone]


#91449

Fromrandom832@fastmail.us
Date2015-05-29 08:12 -0400
Message-ID<mailman.174.1432901568.5151.python-list@python.org>
In reply to#91425
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 to 
> the power of 4 different thruth tables possible, which is indeed 16.
> 
> Perhaps you have a link to all possible 16 thruth tables and their formal 
> names ? That would help !

http://en.wikipedia.org/wiki/Truth_table#Binary_operations

Scroll down a bit for the formal names.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web