“Or” does not always require exactly one choice: under the standard inclusive Boolean interpretation, A or B is true when either or both are true. In everyday conversation, however, a speaker asking “Would you like tea or coffee?” may expect one selection, while a registration form asking whether someone has experience in English or Mathematics may include people with both. Confusing inclusive disjunction, exclusive choice and an uncertain list of alternatives can deny eligibility, produce invalid form rules or cause an AI agent to make the wrong selection. The connector is short; its operational meaning can be consequential.
The practical procedure is quote the source → identify alternatives → specify whether both are allowed → identify the question or action → test neither, first, second and both → preserve authority and context → verify the result. This article distinguishes established Boolean logic, alternative semantics and conversational inferences from implementation choices in JSON Schema and SHACL. It explains why anyOf, oneOf, sh:or and sh:xone implement different constraints without pretending that every use of ordinary “or” has one universal truth table. It proceeds from one word to forms, databases, AI tools, translation and public communications.
- Inclusive OR: One or both conditions may hold.
- Exclusive OR: Exactly one alternative qualifies.
- Choice: A conversational offer may pragmatically invite a single selection.
- Unknown: An unobserved option is not automatically false.
- Schema:
anyOfdiffers fromoneOf. - Shapes: SHACL offers
sh:orandsh:xone. - Negation: “Not A or B” can hide scope ambiguity.
- Authority: Passing validation does not grant permission to act.
- Testing: Always include the both-true case.
- Limit: A logical operator does not settle every pragmatic interpretation.
The truth table: both-true is decisive
| A | B | Inclusive OR | Exclusive OR |
|---|---|---|---|
| False | False | False | False |
| True | False | True | True |
| False | True | True | True |
| True | True | True | False |
1. Classical OR is inclusive in its truth table
The Stanford Encyclopedia of Philosophy entry on Disjunction states the usual classical interpretation: A OR B is true if at least one proposition is true. When both are true, the disjunction remains true. It is false only when both propositions are false.
This is a formal relationship among propositions whose meanings are already defined. It does not determine whether an everyday offer requires a single selection. An AI language system must identify the task and source before selecting a technical operator; a mathematical rule cannot recover a speaker’s intention automatically.
2. Exclusive OR deliberately excludes both
Exclusive OR or XOR requires exactly one of two Boolean conditions to hold. A form that permits selecting either an afternoon or an evening session, but prohibits attending both, may need an exclusive selection rule.
The important test is not whether A alone and B alone work: those cases pass both inclusive and exclusive OR. The difference emerges when the user legitimately satisfies both conditions. That case must be included in the evaluation and made clear in the user-facing explanation.
3. The four Boolean cases settle one narrow problem
The cases are neither true, only A true, only B true, and both true. Inclusive OR accepts the last three; XOR accepts only the middle two. That fact gives implementers a compact test suite.
Do not mistake a successful four-row implementation for proof that the organisation chose the right rule. The people responsible for the actual policy still need to determine whether one or both options should be allowed. Implementation quality and governance are separate questions.
4. A conversation’s OR is context sensitive
“Tea or coffee?” may invite one drink because that is customary in a particular interaction. “Have you studied Mathematics or English?” often includes the person who studied both. The same connector appears, while the conversational purpose changes.
Linguistic research on disjunction discusses pragmatic inferences, alternatives and conversational expectations. These can be cancellable or context-dependent. A machine that always maps ordinary or to XOR, or always insists on an inclusive reading, will misunderstand some legitimate utterances.
5. Either does not automatically enforce XOR
A writer may say “Use either format A or format B,” expecting the reader to choose one. But ordinary language can admit other interpretations when the situation allows both. The word either is not a magic encoding of exclusive validation in all contexts.
For consequential rules, write “exactly one” or “at least one, both allowed.” The implementation can then preserve the explicitly selected cardinality. This is more reliable than asking a model to infer a hidden exclusion from a familiar conversational phrase.
6. A list of possibilities is not an action permission
“The document is in folder A or folder B” can express uncertainty about its location. It does not authorise the agent to move the document into either folder or to disclose its contents.
An evidence record should distinguish uncertain facts from offered alternatives and authorised actions. If the location is important, the assistant can search an appropriate source or ask a targeted clarification. It should not transform an epistemic alternative into an executable instruction.
7. An incomplete list might not be exhaustive
A technician’s note says, “The fault may be in the battery or charging cable.” Those are candidate causes, not necessarily the only possible explanations. An AI that turns the phrase into “exactly one of these causes must be true” has invented completeness.
Source records can state whether the alternatives are exhaustive, illustrative or unknown. A diagnostic flowchart may require a controlled full list, while ordinary speech often does not. The system should not force the world into two categories simply because two possibilities were mentioned.
8. The scope of NOT changes the result
NOT (A OR B) excludes both alternatives, whereas (NOT A) OR B allows a different set of combinations. A policy that merely says “not A or B” can therefore be underspecified if it is being converted into a formal rule.
Use explicit grouping and a plain-language explanation of accepted cases. A logical parser should not silently place parentheses wherever they produce the most convenient outcome. A reviewed representation is essential when different readings change access, reporting or eligibility.
9. De Morgan’s laws can verify structured rewrites
Under classical Boolean logic, NOT (A OR B) corresponds to (NOT A) AND (NOT B). Similarly, NOT (A AND B) corresponds to (NOT A) OR (NOT B). Such identities help check that a structured rewrite preserves its formal truth conditions.
The algebra does not establish that the natural-language source was unambiguous or parsed correctly. A readable sentence such as “neither option applies” may convey the intent more clearly to a user, but the underlying formal variables and scope still need evidence and review.
10. A choice may concern fields or whole documents
A form could require at least one of email and phone, while a separate API might accept several complete document structures. The meaning of one option differs depending on whether the alternatives are fields, formats or validated object shapes.
A model should carry the semantic type of what is being chosen. Requiring exactly one matching subschema is not automatically the same as requiring exactly one visible field. The schema’s structure and overlapping constraints determine the technical behaviour.
11. JSON Schema anyOf is one-or-more matching branches
The official JSON Schema reference states that anyOf accepts an instance conforming to at least one subschema. The instance may satisfy several at once.
This operator is appropriate for technical validation where multiple qualifying branches are acceptable. Its successful result proves only conformity to those selected constraints. It does not verify the factual truth of submitted information or grant permission for any downstream action.
12. JSON Schema oneOf is exactly one matching branch
The same reference specifies oneOf for exactly one matching subschema. An instance satisfying two overlapping branches fails. This can surprise developers who expected the keyword to mean that a user chose one form field.
Use explicit overlap tests. If a rule says “multiple of three” or “multiple of five”, the number fifteen satisfies both, so it passes anyOf but fails oneOf. This small counterexample exposes the semantic difference more reliably than a broad slogan about exclusive choice.
13. A fifteen-versus-ten test reveals overlap
Ten satisfies the multiple-of-five branch but not the multiple-of-three branch; nine has the reverse relation. Both can pass the two-branch oneOf. Two satisfies neither and fails both kinds of combination.
Fifteen satisfies both, making it the critical counterexample. These values are useful for a regression suite because the only relevant issue is the logical condition. The lesson carries into more complicated schemas, where overlapping branches may be difficult to notice.
14. SHACL provides logical shape combinations
The W3C SHACL Recommendation specifies sh:or, requiring conformity to at least one given shape, and sh:xone, requiring conformity to exactly one. These are formal validation operators over specified RDF shapes.
They are not truth certificates. A graph may satisfy every declared shape and still contain an incorrect real-world assertion, a mistaken entity identity or an obsolete policy. Validation is useful precisely when its claim is kept narrow and testable.
15. An inclusive condition can include more people
A fictional enrolment form asks whether a person completed English or Mathematics. If the intended rule is at least one subject, a learner who completed both must remain eligible. An unintended XOR implementation would reject an otherwise eligible case.
Testing the both-true row is therefore not pedantry. It prevents a category system from falsely treating overlapping qualifications as impossible. The actual eligibility policy should be obtained from its legitimate source instead of inferred from convenient interface controls.
16. An exclusive choice can also be legitimate
A timetable may require exactly one session because two sessions overlap. A user selecting both could create an invalid reservation. A verified exclusivity rule may be necessary and easy to explain.
A responsible system should not always favour inclusiveness if the actual constraints are exclusive. It should preserve the operative choice and show why the user cannot select both. Clear wording and correct validation are complementary, not competing goals.
17. Unknown is not the same as false
The Boolean table assumes fixed truth values. In real data, the system may not know whether someone holds a qualification. Treating a missing record as false may misclassify people whose evidence has not yet been reviewed.
An open-world registry needs a separate information state for unknown or unverified values. This is a data-policy question beyond ordinary OR. A formal Boolean operator should be applied only after the meaning of missing information has been specified.
18. Validation is not consent
A person may supply either email or phone to complete a form. That fact does not establish consent for unsolicited marketing or third-party disclosure. Input completeness and legal or procedural permission are distinct.
Keep the relevant principal, purposes and actual consent controls separate from OR validation. An AI agent must not treat a field matching a schema as authority to send information. A properly typed system distinguishes technical validity from allowed conduct.
19. AND does not necessarily establish order
“Mira opened the file and sent the report” often suggests that opening came first. Basic Boolean conjunction merely states that two propositions are true and does not encode temporal ordering. Conversational interpretation can contribute more than the formal operator.
An action pipeline should preserve actual event timestamps and sequence restrictions. Checking that opening and sending both occurred is insufficient when a valid process requires approval or review before delivery. Language engineering should keep temporal conditions separately from AND.
20. A connector can join different grammatical types
Natural-language OR can connect nouns, verbs, phrases or complete clauses. “Tea or coffee” is not the same type of structure as “The package is in Room A or Room B.” The first may be an offer; the second an uncertain location assertion.
Identify the alternatives’ semantic types and the utterance’s conversational purpose before compiling a rule. If an agent strips away the question, modality or source, the same words can be transformed into a materially different instruction. Typed roles are more informative than keyword matching.
21. A user interface needs clear cardinality text
A form with checkboxes can allow multiple options, while a radio group ordinarily permits one choice. Yet visual widgets do not make the policy self-explanatory, especially when users access the service using different devices or assistive technologies.
Write “Select all that apply” or “Choose exactly one” as appropriate. Validate the same rule on the server and include useful error messages when a selection is invalid. Accessibility and logical correctness both depend on consistency between the message and the implemented constraint.
22. Translation can reverse the intended selection
An English statement allowing “A or B, or both” may become a target-language sentence understood as a single exclusive choice. The reverse mistake can also occur, allowing combinations that the source rule prohibits.
A translation brief should state exactly which choices are permitted. Qualified reviewers can test neither, A-only, B-only and both. A fluent word-for-word rendering is not sufficient evidence of equivalent choice semantics when rights or external actions depend on the result.
23. Choice rules can change over time
An organisation might first restrict users to one contact channel and later permit simultaneous email and SMS. The same field names may remain while the valid combinations change from exclusive to inclusive OR.
Version the rule and record the effective dates. Historical selections should be interpreted under the policy that actually applied at the time. A machine should not infer an earlier user preference from options that were not previously available.
24. Permission under OR can create free-choice implications
In conversation, “You may take tea or coffee” can suggest that each drink is individually available. Philosophers call this family of effects free-choice inferences and examine pragmatic, modal and alternative-based explanations.
The SEP entry on disjunction surveys such theories. A technical decision system should not infer unlimited rights from an ordinary conversational effect. The operative policy, source and any exceptions determine real permissions.
25. Nested OR and AND require explicit grouping
“Choose A or B and provide C if required” can describe different selection combinations depending on which phrases are grouped and which condition applies. A human reader may supply a reasonable interpretation that the software parses differently.
Use brackets or structured constraints for the machine and clear prose for the user. Test conditions in combination, including exceptions and missing records. When the authority’s intended rule is unclear, request clarification rather than committing an unsupported interpretation to production.
26. A correct statement can answer the wrong question
Suppose a parent asks whether their child can select both subjects. The assistant answers “At least one subject is required.” That may be accurate under an inclusive rule but does not resolve the both-true case the parent actually cares about.
A helpful explanation states the permitted combinations explicitly. The question under discussion should guide which part of the truth table is presented. Answer accuracy includes relevance, not simply repetition of a correct but incomplete policy phrase.
27. The model must not invent exhaustive alternatives
When a user says “Perhaps the issue is A or B,” the assistant should not rule out every other cause or select one without diagnostic evidence. Those alternatives were presented as possibilities rather than an approved complete taxonomy.
Keep source confidence, scope and uncertainty attached to the candidates. A reliable model can suggest evidence that would distinguish them and acknowledge other possibilities. A neat two-option output should not be mistaken for a complete account of reality.
28. A four-case audit is cheap and effective
Prepare tests where neither condition applies, only A applies, only B applies and both apply. Compare the results to a reviewed requirement. Add tests for missing data and for external action permissions separately.
Record false approvals, false rejections and misunderstanding of explanatory text. A correct truth-table implementation supports a narrow engineering assurance claim. It does not prove that the chosen policy is fair, factual or legally operative without independent review.
29. Four weeks can establish a useful pilot
In week one, collect ambiguous OR language from a small set of fictional forms and instructions. During week two, define alternatives, cardinality, source and examples. In week three, implement schema tests and check multilingual explanations.
During week four, review where users and models misunderstood both-true or neither-true cases and fix those failures. Retain regression examples for later releases. The result is evidence of improved handling in one workflow, not proof of a universal natural-language compiler.
30. The durable semantic layer preserves choice and authority
A shared representation can keep alternatives, inclusive or exclusive operator, conditions, source version and a user’s actual decision distinct. Different languages and interfaces can express the same allowed combinations with different words.
Human conversation still carries social assumptions that Boolean algebra does not encode. A practical universal-language ambition should connect formal logic with ordinary discourse without mistaking either one for complete truth or legitimate authority.
Twelve-step disjunction and decision audit
- Identify the source wording and actual user task.
- List the alternatives and the scope of each.
- Distinguish a question, an uncertain fact and an authorised choice.
- State inclusive, exclusive or another specific cardinality.
- Check whether the list is complete or illustrative.
- Test neither, A-only, B-only and both.
- Preserve negation, nested grouping and exceptions.
- Keep missing evidence distinct from false.
- Compare user instructions with implemented validation.
- Verify authentication and action permission separately.
- Test translated forms and historical policy versions.
- Retain corrections and negative regression examples.
Frequently asked questions
Does or always mean exactly one?
No. Classical inclusive OR accepts either or both, while an explicitly exclusive choice permits exactly one.
What does XOR mean?
Exclusive OR: exactly one of two Boolean alternatives is true.
Why is the both-true case important?
It is where inclusive OR and XOR disagree.
Does either force an exclusive choice?
Not in every everyday context. State the required cardinality explicitly in consequential instructions.
What is JSON Schema anyOf?
A schema-combination rule requiring an instance to match one or more subschemas.
What is JSON Schema oneOf?
A rule requiring exactly one matching subschema, with overlapping matches causing failure.
Can fifteen fail oneOf?
Yes, when the branches require multiples of three and multiples of five, because fifteen matches both.
What is SHACL sh:xone?
A validation component requiring conformity to exactly one listed shape.
Does successful validation prove consent?
No. A field’s schema validity is not authority to process data or perform actions.
Can OR express uncertainty?
Yes. A speaker can list alternative explanations without offering a practical choice.
Does not A or B always mean neither?
No. Different groupings of NOT and OR can produce different results.
How should a team begin?
Document its permitted combinations and test all four Boolean cases against both prose and software.
Continue the Language Engineering series
- Quantifiers, negation and scope
- Defaults and exceptions
- Semantic compatibility contracts
- Consent and permitted actions
- Only, even and focus-sensitive meaning
Primary logic and validation references
- Stanford Encyclopedia of Philosophy: Disjunction
- JSON Schema: Boolean Schema Combination
- W3C SHACL Recommendation: Logical Constraints
- Stanford Encyclopedia: Pragmatics
- RFC 2119: Requirement Words
Editorial scope (27 November 2026): Inclusive and exclusive Boolean logic, JSON Schema and SHACL have formally specified meanings. The choice protocol is a proposed application to natural-language instructions, not a universal theory of conversational intent or a grant of real-world permission. All selection examples are fictional and require relevant governing sources before actual decisions.