Declarative Objectivity (DO) Language : Operator Expressions : Logical Operators
Logical Operators
Logical operators produce Boolean values from the negation, conjunction, or disjunction of one or more Boolean expressions.  
Operator
Description
Usage
First Operand
(op1)
Second Operand
(op2)
Result Type
!
NOT
Unary negation
!op1
NOT(op1)
Boolean
Boolean
&&
AND
Conjunction
op1 && op2
op1 AND op2
AND(op1, op2)
Boolean
Boolean
Boolean
||
OR
Disjunction
op1 || op2
op1 OR op2
OR(op1, op2)
Boolean
Boolean
Boolean
^^
XOR
Exclusive disjunction
op1 ^^ op2
op1 XOR op2
XOR(op1, op2)
Boolean
Boolean
Boolean
Quick Look 
Find the vehicle with either of the specified license numbers:
FROM Vehicle WHERE license == 'ABC1997' OR license == 'XLT5664' RETURN available;
Find the vehicles that are available and have a manual transmission:
FROM Vehicle WHERE available AND !model.automatic RETURN license;
Find the vehicles that are available and have a manual transmission:
FROM Vehicle WHERE available && NOT(model.automatic) RETURN license;
Discussion 
For general information about operator formats, operands, and precedence, see About Operator Expressions.
Typical operands are nested operator expressions that use Relational Operators or regular expression String Operators.
Truth Value Table
The following table shows the results for the logical operators given the possible combinations of operands.
Operands
Conjunction
Disjunction
Exclusive Disjunction
Unary Negation
false
false
false
false
false
false
true
false
true
true
false
null
false
null
null
true
false
false
true
true
true
true
true
true
false
true
null
null
true
null
null
false
false
null
null
null
true
null
true
null
null
null
null
null
null
false
true
true
false
null
null