logical NOT operator

Features wanted...
Leopoldus
Posts: 237
Joined: 24 Jun 2004 10:58

logical NOT operator

Post by Leopoldus »

Is there some plans concerning logical operator "NOT" using in search expression?

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: logical NOT operator

Post by admin »

NOT really. :wink:
Miss it?

Leopoldus
Posts: 237
Joined: 24 Jun 2004 10:58

Post by Leopoldus »

Yes, I do. There are three logical operator commonly used in searching, but TrackerV3 has only the two of them. If you'll add the third, we will get a perfect searching software :D

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Leopoldus wrote:There are three logical operator commonly used in searching...
Since you seem to be a search logic enthusiast: suggest a symbol/operator/syntax for NOT, please.

BTW, Explorer file search can't do NOT, right?

Leopoldus
Posts: 237
Joined: 24 Jun 2004 10:58

Post by Leopoldus »

you seem to be a search logic enthusiast
No, I'm not. Indeed I hate it :twisted: But there are so many files at my computer...
Explorer file search can't do NOT, right?
Do you mean Explorer to be The Standard of Perfect Search Utility?
suggest a symbol/operator/syntax for NOT
I don't think it would be very difficult task.
E.g. dash "-" for "NOT" and double dash for the dash as a part of file/directory name, if somebody needs in such meaning (it's improbable).

By the way, there is alternative for logical operators signs. You could use their directly as words, ie OR, AND, NOT; or [OR], [AND], [NOT]. You see, some files and directories may contain those words and brackets as a part of name, but nobody includes they as a part of a filename in searhing query.
So, sample is:
(Proctor & && & Gamble) -tooth

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Ok, thanks. I'll see into it when I find the time. (It's not as easy to implement as one might think.)

Leopoldus
Posts: 237
Joined: 24 Jun 2004 10:58

Post by Leopoldus »

It's not as easy to implement as one might think.
This "one" is not me, surely. I realize how complex is this task. Wnen I've written "I don't think it would be very difficult task.", I had meaned my own task to suggest the sign for the logical operator, not your mission to implement logical operator into your program.
Thnak you and good luck!

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

I'm thinking about another revision of the search syntax because I don't like the & and | operators: too many keystrokes and not so well readable for non-programmers. What do you think of this reformed system:

Code: Select all

Search Syntax     Boolean Equivalent

cat               "cat"
-cat              NOT "cat"
cat dog           "cat" AND "dog"
cat -dog          "cat" AND NOT "dog"
-cat -dog         NOT "cat" AND NOT "dog"
cat or dog        "cat" OR "dog"
pig or cat dog    ("pig" OR "cat") AND "dog"
pig or cat -dog   ("pig" OR "cat") AND NOT "dog"

Escape character: \
\-cat             "-cat"
cat\ dog          "cat dog"
cat \or dog       "cat or dog"
etc.

These too? (I'd rather not... too confusing)
-pig or cat       NOT (pig OR cat) ???
                  (NOT pig OR cat) ???
-pig or -cat      NOT (pig OR NOT cat) ???
                  (NOT pig OR NOT cat) ???
Donald

Gandolf

Post by Gandolf »

I don't like the first option, too much like plain text. "cat or dog" to me indicates looking for a file named "cat or dog.ext". The "-cat" would certainly not work in my case since I highlight temporary files I want to stand out with "---" prefix (---filename.ext), it makes them very obvious in a file list.

Not sure about the second option, sort of Regular Expression syntax and may confuse people like me who use Regular Expressions as often as possible.

The third one is definitely confusing since it's a mixture of the "-" sign and the "or" logical operator.

I think whatever character you choose sooner or later somebody will use it in a filename. #AND, #OR, #NOT seem to be used frequently in some search engines but you sound as if you want to use an expression with as few characters as possible, so I expect you would consider them too long.

I prefer Regular Expressions but that requires learning their logic and you need to incorporate the entire set to be of any use. It is more confusing if only some of the Regular Expressions work (a text editor I looked at the other day had \t but not \n). It might also be too complicated for the general user.

I'm quite happy with " & " and " | " even though it caught me out after you'd changed it and I recalled an expression from the history with the ";" and then wondered why it couldn't find the files!!!

You could, of course, make it user configurable and that should be able to please everybody (except you, because of the extra code required).

Dave.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

I hear you. I'm convinced. I just come up with a new suggestion (incl. 2 alternative operator sets):

Code: Select all

Search Syntax A           Search Syntax B     Boolean Equivalent

cat                       cat                 "cat"
not cat                   ! cat               NOT "cat"
cat and dog               cat & dog           "cat" AND "dog"
cat and not dog           cat & ! dog         "cat" AND NOT "dog"
not cat and not dog       ! cat & ! dog       NOT "cat" AND NOT "dog"
cat or dog                cat | dog           "cat" OR "dog"
pig or cat and dog        pig | cat & dog     ("pig" OR "cat") AND "dog"
pig or cat and not dog    pig | cat & ! dog   ("pig" OR "cat") AND NOT "dog"
not pig or cat and dog    ! pig | cat & dog   NOT ("pig" OR "cat") AND "dog"

Escape character: \
\! cat            "! cat"
cat \and dog      "cat and dog"
cat \& dog        "cat & dog"
etc.
(I will not go for RegExp for the reasons you named already)
Donald

Gandolf

Post by Gandolf »

I like version B since the AND and OR operators remain the same, you are just adding the NOT operator. I don't think I've ever seen the " ! " used as a not operator - excellent idea. I assume they will require the spaces same as " | " and " & " do. Pity about Regular Expressions but I understand your reason.

Dave.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Gandolf wrote:I don't think I've ever seen the " ! " used as a not operator - excellent idea.
Which tells me you're not a programmer. ! is the standard NOT-operator in languages like C, C++, Java, JavaScript, PHP and more. All those languages also have & for AND and | for OR. So ! for NOT is a very obvious choice here, and not my own idea at all :wink:
Gandolf wrote:I like version B...
My plan was to allow version A and version B at the same time, being friendly to more "verbal" thinkers.

Gandolf

Post by Gandolf »

An ex-programer. Control system software in the 1980's using Z80 and 6800. High level languages hardly existed (Pascal was about the only one) and it was far too slow so everything I wrote was in Assembler. I then moved to management and had other people write the software for me. Now I'm retired I keep thinking I might start again but there aren't enough hours in the day!!

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Gandolf wrote:An ex-programer. Control system software in the 1980's using Z80 and 6800. High level languages hardly existed...
Well, that's what I call a real programmer!

I have to revise my previous syntax chart because I got the operator precedence wrong (in my own program, puuh, but it's very hot outside, you know):

Code: Select all

Search Syntax A           Search Syntax B     Boolean Equivalent

cat                       cat                 "cat"
not cat                   ! cat               NOT "cat"
cat and dog               cat & dog           "cat" AND "dog"
cat and not dog           cat & ! dog         "cat" AND NOT "dog"
not cat and not dog       ! cat & ! dog       NOT "cat" AND NOT "dog"
                                            = NOT ("cat" OR "dog")
cat or dog                cat | dog           "cat" OR "dog"
pig or cat and dog        pig | cat & dog     "pig" OR ("cat" AND "dog")
pig or cat and not dog    pig | cat & ! dog   "pig" OR ("cat" AND NOT "dog")
not pig or cat and dog    ! pig | cat & dog   NOT "pig" OR ("cat" AND "dog")

Escape character: \
\! cat            "! cat"
cat \and dog      "cat and dog"
cat \& dog        "cat & dog"
etc.


So, AND precedes OR by default (and there's no way to overwrite the default because I do not want to introduce parentheses - it would just be too much).
Does everybody find the above system (which includes 2 parallel versions A and B) intuitive and easy to handle and remember? (Note, that the NOT operator does not yet exist in the current version!)

Donald

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Post by admin »

Gandolf wrote:... I'm quite happy with " & " and " | " even though it caught me out after you'd changed it and I recalled an expression from the history with the ";" and then wondered why it couldn't find the files!!!
This happened to me, too. I think the ";"-operator for OR should be kept alive as an alternative to " | " and " or " because it's already generally known from file open dialog patterns like "*.ico;*.gif;*.jpg". Right?

Donald

One day later: NO, not a good idea. Forget the ";"-operator.
Donald
Last edited by admin on 04 Aug 2004 15:23, edited 1 time in total.

Post Reply