Mapping Complex Expressions
Representing Complex Expressions
When translating paper catalogs to electronic form, it’s common to find applications with complex qualifier expressions (possibly created to save space). Here are a few example expressions that include OR logic:
- 4WD Japan Built or RWD
- Convertible or Sedan w/Disc Brakes
- 8” Diameter Booster w/ABS or 10” Diameter Booster
Since Vehicle Attribute/Qualifier tags on an application are combined logically with “AND”, we need a way to represent “OR”. The solution is to create separate applications (using separate comment OR maps). Here is the coding for the first expression shown above. Notice two applications were created. (Some required tags are not shown).
<App action="A" id="1" ref="1">
<DriveType id="8">4WD</DriveType>
<Note>Japan Built</Note>
</App>
<App action="A" id="2" ref="1">
<DriveType id="7">RWD</DriveType>
</App>
The second example is like the first, except you need to interpret what it means. It could mean the part fits all
Convertibles as well as Sedans with Disc Brakes. Or it could mean it fits all Convertibles with Disc Brakes as well
as all Sedans with Disc Brakes. A further complication is the need to designate the correct front or rear brake tag
(<FrontBrakeType id="5"/>). A similar problem is found with 2 and 4 wheel ABS.
The third example shown above would produce the following three applications (assuming the vehicle came with both 2/4 ABS):
<App action="A" id="1" ref="3">
<BrakeABS id="7">2-Wheel ABS</BrakeABS>
<Note>8" Diameter Booster</Note>
</App>
<App action="A" id="2" ref="3">
<BrakeABS id="8">4-Wheel ABS</BrakeABS>
<Note>8" Diameter Booster</Note>
</App>
<App action="A" id="3" ref="3">
<Note>10" Diameter Booster</Note>
</App>
Applications written with “Except” logic can be particularity challenging since Except is not supported on vehicle attributes. (Except can be included in Vehicle Qualifier text, however). The following rules (known as DeMorgan’s Laws) can be used to translate Except logic in your applications.
Exc. (A and B) <==> Exc. A or Exc. B
Exc. (A or B) <==> Exc. A and Exc. B
An understanding of these rules is necessary because parentheses are often implied in many real-world expressions (and since this kind of grouping is not supported in the delivery of applications).
These rules can be used to put applications in the form: (A and B) or (C and D) or (E and F). It is then a simple matter to split the ORed applications as required (in this case, into three separate applications).