Operator Precedence/Boolean Logic

Steven D'Aprano steve at pearwood.info
Sat Jul 16 12:36:09 EDT 2016


On Sat, 16 Jul 2016 10:15 pm, Rustom Mody wrote:

> Earlier you said:
> 
>> > 1. Graphs -- the kind mathematicians define with "Let G =(V,E) be a
>> > graph..."
>>  
>> I would make the empty graph (zero nodes) falsey, and non-empty graphs
>> (one or more nodes) truthy.
>>  
>>  
>> > 2. Automata which in a way are special kinds of graphs
>>  
>> As above.

If automata are graphs, and there is a zero-node graph that represents an
automation, then it should be falsey. If there is no such "empty
automation", then there shouldn't be. Was that unclear? If I failed to make
that obvious enough for you to understand, then I apologise.

It may be that you feel that there's no such thing as an empty automation.
Okay, that seems reasonable to me too. One can map functions to
flow-charts, which are a special kind of graph too. But a flow chart with
no elements is no flow chart at all: even the identity function, or the
do-nothing procedure, will be represented by a flow chart with at least one
node. So there are no falsey functions. Maybe there are no falsey automata
either.



> Now you say:
> 
>> > If on the other hand you are giving that “return True”as a serious
>> > useful definition?
>>  
>> Sure. An automata is an object, and by default, all objects are
>> "something" and hence truthy. That's the "no-brainer" answer, it requires
>> no justification at all. If you think the answer should be something
>> else, *that* is what needs justification. Why shouldn't it be truthy?
> 
> 
> How do we put these two together?

Um, in the obvious, straightforward way?

What part of my statements is giving you trouble? Should I use smaller
words? Bigger words? Draw a picture?

Automata were *your* idea. I have no concept of what *your* idea of automata
are, except that *you* claim that they are a kind of graph. If you want to
specify the semantics of automata that you consider important in detail,
then perhaps we can decide which ones should be falsey (if any). Otherwise
I'm reduce to talking in generalities, as the question is under-specified.

If there are automata equivalent to the empty graph (graph with no nodes),
then they should be falsey. All others (those equivalent to graphs with one
or more nodes) should be truthy. If you disagree, well, Rustom, it's YOUR
class, you tell me under what conditions you think an automation object
should be considered truthy or falsey.

Mu is not an option. You have to pick one or the other.



-- 
Steven
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list