News for hackers. Stuff that matters.
Re:If-then-else had to be invented by powersnail on Sunday December 13, 2020 @10:37AM (#25407232)
The word “and” in English is simply there to join multiple clauses together. Whether it is a set union or set intersection, (or some other relations) depends on the sentence.

Set union: they can read and write’

Set intersection: my jeans were creased and dirty

Sequential: he turned round and walked out

Causal: there was a flash flood and by the next morning the town was under water’

And, there are many more usages.

Re:If-then-else had to be invented by chalst on Sunday December 13, 2020 @11:52AM (#25407895)
This is correct. The technical word linguists use for the role words like "and" play is coordination.

https://en.wikipedia.org/wiki/Coordination_(linguistics)

Re:If-then-else had to be invented by DFHippie on Sunday December 13, 2020 @11:49AM (#25407861)
I would say that in every case there is a set of things (maybe with a single member) and a set of predicates (maybe with a single member), a mapping from the things to the predicates, and every mapping produces a true proposition.

"Women and children were present" isn't saying the intersection of the women and children were present but that the things were women and children and they all were present.

The rest of the variety of "meanings" of "and" are just inferences on top of this basic meaning. If things occur in sequence, for instance, we can infer causality from what we know about the things conjoined apart from the conjunction.

Crucially, there is more here than just "joining multiple clauses together" (and many of the things conjoined aren't clauses), because "or" can be described this way too, but "and" does not mean the same thing as "or". With "or" you are only asserting that some of the propositions are true.

Re:If-then-else had to be invented by powersnail on Sunday December 13, 2020 @12:32PM (#25408259)
The meaning of “and” in natural language predates the meaning of “and” used in logics and set theories. I’m not convinced that all semantics of “and” can be derived from set operations.

1) not every clause is a predicate and applying logical operators to a non-predicate makes very little sense to me.

2) I don’t see how ordering, time, and causation can be inferred, if you treat each clause as a predicate.

“I punched Bob and apologized” has a different meaning than “I apologized, and punched Bob.”

The AND as used in logics simply doesn’t embody this usage.

—-

It was a sloppy wording of mine to say that AND just join clauses together. I meant to say that it joins clauses together, and the relations between the clauses are not necessarily set union. Of course it can’t embody all relations, but more than set unions.

Re:If-then-else had to be invented by DFHippie on Sunday December 13, 2020 @04:17PM (#25410374)
I'm being a little sloppy in my language as well.

Since words and phrases necessarily occur in sequence, if you are speaking of things can be and typically are in sequence, it is natural to infer that the speaker is presenting them in the sequence of their occurrence. The speaker can do this, the speaker and the hearer both know that the speaker can do this, and it is a common understanding between the speaker and the hearer that the speaker intends the hearer to receive a particular representation of events: this is the purpose of communication. This being so, the speaker presenting events out of their temporal sequence would be perverse. If the speaker knows the hearer will assume she is presenting events in their temporal sequence, she must present them in this sequence or explain that they are not so presented. To do otherwise would be understood by the speaker and hearer as deliberate deception.

So the sequence comes not from the semantics of "and" but the pragmatics of speaking itself. In fact, you don't need "and" at all. If you leave "and" out -- asyndeton -- and list things, they will be understood to be in temporal sequence if they are the sort of thing that occur that way. "I opened the door. I went out."

All of these "meanings of and" can be explained via pragmatics and a very simple meaning of "and". The meaning I provided was intended as a hand-wavy gesture in the direction of a more formal theory.

Re:If-then-else had to be invented by mhink on Sunday December 13, 2020 @05:11PM (#25410870)
> I’m not convinced that all semantics of “and” can be derived from set operations.

Totally agree. I think part of the issue is that "natural-language and" behaves differently when you apply it to different parts of speech, and everyone in this thread is thinking of a different part!

That being said, in the example sentences you gave ("I punched Bob and apologized" vs. "I apologized and punched Bob"), it's actually ambiguous whether they have equivalent meaning or not, when we ONLY consider grammar. Using ONLY the words in the sentence, the relationship between "apologized" and "punched" rests on our interpretation of "and"'s grammatical role. Taken in its usual sense as a conjunction, the two verbs are only related in the sense that the same subject performed them.

But I think you're arguing that "and" places the two verbs in sequence (which prevents the sentence from being flipped without changing meaning.) The more I think about this, the more I don't think it follows. To read the verb phrase this way, the reader has to infer a missing conjunctive adverb: ("punched Bob and [then] apologized")... and in order to make that inference, you need context from the sentence.

To make matters more complicated, we _could_ interpret the sentence in a way that doesn't imply the verbs are related: suppose the speaker is apologizing to some third party, and punches Bob for some unrelated reason. If we interpret it this way, the two sentences can be switched without changing the meaning too much.

But all this just goes to show: your core point is correct: natural languages aren't formal languages, and trying to treat them as such is an exercise in frustration.

Re:If-then-else had to be invented by patates on Monday December 14, 2020 @08:43AM (#25417377)
> The meaning of “and” in natural language predates the meaning of “and” used in logics and set theories

Yes and it's usually very hard to summarize what words can mean in different contexts, therefore it's usually harder to learn natural languages than programming languages. For example, in a programming language "while you're out, pick up some milk" would be an infinite loop. I think this is why Alexa, Google Assistant, Siri and many more are only finding usage for the simplest of tasks.

Re:If-then-else had to be invented by edflsafoiewq on Sunday December 13, 2020 @12:03PM (#25407997)
"(Women were present) and (children were present)"
Re:If-then-else had to be invented by chalst on Sunday December 13, 2020 @12:24PM (#25408176)
How would you distribute "Jack and Jill play together."? If you start introducing prepositions, then your theory of "and"-expansion is going to get quite complex as it covers more and more cases.
Re:If-then-else had to be invented by XorNot on Sunday December 13, 2020 @09:54PM (#25413016)
Isn't this basically proper nouns implicitly creating a set of size 1?
Re:If-then-else had to be invented by linuxrebe1 on Sunday December 13, 2020 @12:20PM (#25408143)
Short would be, 'and' implies, coincidence, not causality. 'Or' implies choice. If-then implies causality ("If my pants are dirty, then they need to be cleaned")

The big difference I see is with 'OR' in programing the options are exclusive. Ex: "Are you tired or hungry" The answer is yes if you are tired. Yes if you are hungry, Yes if you are both. No if you are neither. This is natural English. In programming if you are both. The answer is No.(False)

Re:If-then-else had to be invented by patmorgan23 on Sunday December 13, 2020 @12:32PM (#25408257)
Isn't OR in most languages non exclusive? If you want exclusive OR you use XOR.
Re:If-then-else had to be invented by tel on Sunday December 13, 2020 @11:01AM (#25407423)
How is your set union example not another intersection (your quantification could go in one of two places though, they = (set of readers) cap (set of writers) versus they = { p in people such that (p writes) cap (p reads) }.
Re:If-then-else had to be invented by powersnail on Sunday December 13, 2020 @12:46PM (#25408387)
> they can read and write

Note that I’m not joining people with AND. I joined abilities.

For instance, to expand on the example.

I have three Pokémons. They can read and write.

I’m not saying that my three Pokémon are the intersection of reading Pokémon and writing Pokémon. There might be other Pokémon who can do just the same.

I’m saying that what they can do is a union of writing and reading.

EDIT: spelling

Re:If-then-else had to be invented by drdeca on Sunday December 13, 2020 @02:31PM (#25409370)
But they are in the intersection of "entities that can read" with "entities that can write".
Re:If-then-else had to be invented by dragonwriter on Sunday December 13, 2020 @06:11PM (#25411423)
Yes having attributes containing the union of the sets of attributes {“can read”} and {“can write”} means being in the intersection of the set of things having the attribute “can read” and that having the attribute “can write”. Set union, intersection, and membership are related that way.

(Which means saying that “and” is about intersection and not union is nonsense, everything statement about set union can be rephrased to an equivalent statement about intersection, and vice versa.)

Re:If-then-else had to be invented by drdeca on Sunday December 13, 2020 @07:12PM (#25411876)
Yeah, there's some duality there. If each predicate is identified with the set of things that satisfy that predicate, then the "and" of two predicates is identified with the intersection of the sets that satisfy the two predicated. On the other hand, if you instead use predicates by talking about the set of predicates that objects satisfy, then saying that something satisfies one set of predicates, and satisfies some other set of predicates, then that says that the thing satisfies all the predicates in the union of those two sets.

For some relation R between elements of the set X and elements of the set Y (we can think of X as being the set of individuals, and Y as being a set of elementary unary predicates), for each x in X, we can refer to A(x) := {y in Y : x R y} , and for each y in Y we can talk about B(y) := {x in X : x R y} . When we say (x_1 R y_1) && (x_1 R y_2), this is equivalent to both (x_1 in B(y_1)) && (x_1 in B(y_2)) i.e. (x_1 in (B(Y_1) intersect(B(y_2)))) , and also to (y_1 in A(x_1)) && (y_2 in A(x_1)) , i.e. ({y_1} \subset A(x_1)) && ({y_2} \subset A(x_1)) i.e. (({y_1} union {y_2}) \subset A(x_1)) .

Personally, if we are talking about a single x_1, and we are saying "and" about a number of different y_1 , y_2 , etc. , or if we are talking about each x in some collection but are saying the same thing about each of them, namely that for each x in the collection, that x R y_1 and that x R y_2 and that x R y_3 , I think it seems more natural to take the first of the two framings described above. That is, I think it seems more natural to say that for each x in the collection, that x \in (B(y_1) intersect B(y_2) intersect B(y_3)), rather than saying that ({y_1} union {y_2} union {y_3}) subset A(x) .

Or, if we give the name W to the collection we are talking about, we could say that "W subset (B(y_1) intersect B(y_2) intersect B(y_3))". This seems to me a fairly natural way to say "all the W , y_1 , y_2, and y_3" ("each of my 3 pokemon can do reading, writing, and arithmetic") .

The other way would end up more like, "({y_1} union {y_2} union {y_3}) subset (the intersection over all x in W, of A(x))".

This works, but seems less natural to me.

Also, especially in the case where you expect X to be substantially larger than Y.

Re:If-then-else had to be invented by gerdesj on Sunday December 13, 2020 @05:29PM (#25411041)
"I have three Pokémons. They can read and write." cf: I have three Pokémons that can read and write.

Now, thanks to what I can only describe as the implicit vagaries of English, the bounding (three) might now imply that I have three ... or more Pokémons! To make that sentence precise: I have three Pokémons and they can read and write. Here I am substituting and for a full stop (period.) When I deployed "that" I managed to muddy the waters.

Mapping logical and Boolean operators to grammatical constructs is tricky and should not be taken lightly. Best to consider them separately. AND is not and (except when it is!)

Be careful out there kids.

Re:If-then-else had to be invented by remram on Sunday December 13, 2020 @11:23AM (#25407634)
It depends if you consider the implied set to be the people (of which there are readers and writers) or the capabilities (reading and writing).
Re:If-then-else had to be invented by phkahler on Sunday December 13, 2020 @01:18PM (#25408703)
>> Set union: they can read and write’

>> Set intersection: my jeans were creased and dirty

IMHO those are both unions. One describes two capabilities people have while the other describes two conditions some clothing has.

They both become intersection when using the pair of conditions as selection or decision criteria.

It's the difference between an assertion and a question.

Re:If-then-else had to be invented by _emacsomancer_ on Sunday December 13, 2020 @12:59PM (#25408512)
To join like constituents, not just clauses, as per your examples.
Re:If-then-else had to be invented by Toenex on Sunday December 13, 2020 @11:14AM (#25407546)
It's surprising how often you can replace 'but' with 'and' in a sentence.
Re:If-then-else had to be invented by thaumasiotes on Sunday December 13, 2020 @03:17PM (#25409810)
Why is that surprising? They have exactly the same meaning; the difference is that 'but' additionally carries information about the subjective point of view of the speaker. (Where 'and' indicates that two things are true, 'but' indicates that (1) two things are true; and (2) the speaker considers this surprising or anticipates that the listener might find it surprising.)
Re:If-then-else had to be invented by jfoutz on Sunday December 13, 2020 @11:45AM (#25407812)
coordinating conjunctions are wierd. and, or, for, but, yet, so, nor. Nor is sort of an oddball there, since it continues negated clauses, well I use it to. - my jeans were neither creased nor dirty. Yet fits in a ton of places as well.