Multiple Boolean Expressions in a Rule Definition

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Post Reply
jh
New Member
Posts: 2
Joined: 2008 Aug 21, 15:24

Multiple Boolean Expressions in a Rule Definition

Post by jh »

This topic thread comes from the xplorer² Professional forum. Moved here 19-May-2010
While Boolean logic may not be anybody's 'favorite' thing, the following thread tells how to synthesize any filter from its logical elements using the syntax available in xplorer² -- indispensable information when you need to perform complex filtering, and get it right. ;)  =fg=
================================================================

hi,
I would like to know if it is possible to construct a multiple Boolean expression (for a comment) in the rule definition when finding files.
thanks
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Yes, but ...
unless you have a simple case, you need to be familiar with Boolean arithmetic to get what you want.

Note: the 'Rules' are not limited to being applied to the comment field.
Further note: Each 'Rule' accepts a comma-separated list of conditions.
(See Appendix 9L. Boolean multi-strings, in the User Manual)
When NO element in the list uses compulsory + or - modifiers, the 'Rule' represents a Boolean maxterm: i.e. the element tests are OR'ed together. When ALL elements in the list are preceded by compulsory + or - modifiers, the 'Rule' represents a Boolean minterm: i.e. the element tests are AND'ed together.

For the general case, the first step is to write your Boolean expression in canonic form as either a product of maxterms or as a sum of minterms.

Define as many 'Rules' as you have maxterms (minterms), building your filter using a Rule for each maxterm (minterm).

If using a product of maxterms, use only "And" (& "Not") for the context of each 'Rule'.
If using a sum of minterms, use only "Or" (& "Not") for the context of each 'Rule'.

PS - In the User Manual, in Appendix 9O. Common interface amongst multiple commands see subsection "3. The Additional Rules section ..." for more basic information on the user interface for constructing the 'Rules'.

HTH

[edited/expanded when I realized that one can construct a filter using a generalized Boolean expression expressed in either of the two canonic forms.]
jh
New Member
Posts: 2
Joined: 2008 Aug 21, 15:24

Post by jh »

Thank you very much fgagnon for your helpful reply.

I have noted the manual references.

My reason for asking this question in the first place was because I wanted to implement the advice regarding multiple keywords under Chapter 8 "Productivity Tips" (section 7 of "How to extract the most from x^2").
Post Reply