CyberSoft CVDL

CVDL Tutorial

4. XOR and NOT

XOR is the exclusive-OR operator, which by definition can be expressed using AND and OR.

For example, VDL ex3

  ; guns or bullets, but not both
  ;
  :ex3, ("guns" AND NOT "bullets") OR ("bullets" AND NOT "guns") #

can be expressed more efficiently using XOR:

  :ex3, "guns" XOR "bullets" # ; guns or bullets, but not both

ex3 also illustrates the use of the semicolon (;) in VDL files to create comments which extend to the end of the line.

NOT by itself seems to be a strange logical operator for pattern matching, since it means that we have a match if some pattern is not present.

However, consider a situation where all files or email must contain a certain notice, and we want to detect the lack of that notice. An example pattern is:

  :ex4, NOT "Copyright 2001, CyberSoft, Inc." #

Listen to the audio

Contents | Previous | Next