Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Is concatenation a logical AND?

Parent

Is concatenation a logical AND?

+4
−4

As a person with no significant background in mathematics and computer science I thought that concatenation and AND are logically identical if not very similar because both add something to something yet not by numerical addition (natural addition) so I found it sensical to say "x AND y" is weight to "x . y". But of course I might be wrong, so I ask:

Is concatenation (for example, as with . in PHP) a logical AND?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

General comments (7 comments)
Post
+3
−5

It is OR.

Assimilate FALSE to the empty string, and TRUE to any other string:

ε CONCATENATE ε = ε
ε CONCATENATE something = something
something CONCATENATE ε = something

What about both sides at TRUE:

something CONCATENATE something = somethingsomething

But because any non empty string assimilates as TRUE:

something CONCATENATE something = something
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

General comments (1 comment)
General comments
Derek Elkins‭ wrote about 4 years ago

You should clarify that for programming languages that will treat strings as boolean values and which interpret the empty string as false and all non-empty strings as true, then it will be the case that the boolean value associated to the concatenation will be the disjunction of the boolean value associated to the arguments. These assumptions are not true for PHP, e.g. "0" is false in PHP while "00" is true. These assumptions are also not true for many other languages.