disjunction (or)
on this page
definition
disjunction () is the logical “or” operator that is true when at least one of its operands is true. it represents the idea of choice or inclusion of possibilities.
this can be visualized as a simple flowchart. you reach the “True” outcome if you can answer “Yes” to at least one question.
truth conditions
disjunction follows the principle that any part being true makes the whole true:
T | T | T |
T | F | T |
F | T | T |
F | F | F |
the disjunction is false only when both operands are false.
formal properties
commutativity
order doesn’t matter - “sunny or warm” means the same as “warm or sunny.”
associativity
grouping doesn’t affect meaning - can write unambiguously.
identity element
disjoining with falsehood leaves the original statement unchanged.
absorbing element
any disjunction with truth becomes true.
idempotence
repeating the same statement doesn’t change meaning.
notation variations
- symbolic: , , (in some contexts)
- programming:
||
,or
,OR
- set theory: (union)
- boolean algebra: addition (with )
inclusive vs exclusive or
inclusive or (standard logical or)
- true when at least one operand is true
- allows both operands to be true simultaneously
- standard interpretation in formal logic
exclusive or (xor)
- true when exactly one operand is true
- false when both operands are true
- common in everyday language (“coffee or tea”)
natural language ambiguity: “would you like coffee or tea?” typically implies exclusive choice, but logical or is inclusive by default.
examples
academic requirements
statement: “you need calculus or statistics for this major”
- : completed calculus
- : completed statistics
- : true if you have either course (or both)
emergency conditions
system alert: “shutdown if memory low or temperature high”
def should_shutdown(system):
return system.memory_low() or system.temperature_high()
activates when either condition occurs (or both simultaneously).
eligibility criteria
job requirement: “requires degree in computer science or equivalent experience”
- : has relevant degree
- : has equivalent experience
- : qualified if either condition holds
search queries
database query: find users in engineering or marketing departments
SELECT * FROM users
WHERE department = 'engineering' OR department = 'marketing';
common mistakes
assuming exclusivity
incorrect: treating logical or as exclusive choice correct: inclusive or allows multiple options simultaneously
“students with math or science background” includes those with both.
misapplying de morgan’s laws
incorrect: correct:
negating disjunction produces conjunction, not disjunction of negations.
confusing with implication
incorrect: interpreting ” or ” as ” implies ” correct: disjunction doesn’t establish conditional relationship
“it’s raining or the ground is wet” doesn’t mean rain causes wetness.
relationship to other constructs
with conjunction (and)
de morgan’s laws connect disjunction and conjunction:
- disjunction and conjunction are duals
with implication
disjunction can express implication:
- “if P then Q” means “not P or Q”
with negation
disjunction interacts with negation via de morgan’s laws:
- “not (either P or Q)” becomes “neither P nor Q”
applications
programming logic
# error handling
if network_error() or timeout_occurred() or user_cancelled():
abort_operation()
# validation - accept if any format works
if is_json(data) or is_xml(data) or is_csv(data):
process_data(data)
database queries
-- flexible filtering
SELECT * FROM products
WHERE category = 'electronics'
OR price < 50
OR on_sale = true;
formal verification
liveness property: “system eventually responds or reports error”
ensures system doesn’t hang indefinitely.
logical arguments
premise structure: “if we have physical evidence or witness testimony, then we can proceed”
in natural language
explicit disjunction
- “either…or…” (often exclusive in english)
- “…or alternatively…”
- “whether…or…“
implicit disjunction
- “any of the following…”
- “students may choose…”
- alternative options in lists
ambiguous interpretations
everyday language “or” often implies exclusivity:
- “soup or salad” (restaurant context)
- “turn left or right” (navigation)
- “heads or tails” (coin flip)
philosophical considerations
inclusive interpretation advantage
logical systems use inclusive or because it’s:
- more general: exclusive or is special case
- compositional: easier to combine with other operators
- natural for conditions: “qualified if you meet requirement A or B”
relevance and connection
while logical disjunction doesn’t require meaningful connection, practical reasoning often assumes alternatives are relevant:
- “it’s tuesday or grass is green” is logically valid but pragmatically strange
disjunctive reasoning
disjunction enables:
- case analysis: consider all possibilities
- alternative solutions: multiple paths to goal
- robustness: system works if any component functions
computational aspects
circuit implementation
disjunction corresponds to OR gates:
- output high when any input is high
- complement to AND gates in digital logic
evaluation strategies
programming languages may use:
- eager evaluation: check all operands
- short-circuit evaluation: stop at first true operand
# short-circuit: if first is true, second isn't evaluated
if user.is_admin() or user.has_special_permission():
allow_access()
complexity
for operands:
- truth table size: rows
- satisfying assignments: (all except all false)
- evaluation time: for short-circuiting
related inference rules
addition (disjunction introduction)
from , we can conclude for any :
this might seem counterintuitive - we’re adding uncertainty by introducing .
disjunctive syllogism
from and , we can conclude :
eliminates one option to determine the other.
practical patterns
error handling
def process_file(filename):
if not file_exists(filename) or not file_readable(filename):
raise FileError("Cannot process file")
defensive programming
# multiple fallback options
database = connect_primary() or connect_secondary() or connect_cache()
configuration flexibility
# config accepts multiple notification methods
notifications:
email: user@example.com
sms: +1234567890
# system sends notification if ANY method configured
summary
disjunction provides logical flexibility by accepting multiple ways for statements to be true. its inclusive nature makes it particularly useful for:
- expressing alternative conditions
- building robust systems with fallbacks
- creating flexible requirements
- enabling case-by-case reasoning
understanding the inclusive nature of logical or helps avoid misinterpretations and builds more precise logical arguments.
══════════════════════════════════════════════════════════════════