Or 
例題
すべて開く すべて閉じる例 (4)
スコープ (5)
Orは,引数がいくつでも構わない:
Or[x, y, z]Orは結合である:
Or[x, Or[y, z]]//FullForm明示的なTrueあるいはFalse引数を持つOrは簡約される:
Or[x, False, z]Or[x, True, z]Orは引数を順に評価し,引数の評価がTrueとなったところで停止する:
Or[Print[1];True, Print[2];False]Or[Print[1];False, Print[2];False]x == 0 || y == 1 / x /. x -> 0y == 1 / x || x == 0 /. x -> 0z || y || y || xSimplify[%]TraditionalFormによる表示:
x || y || z//TraditionalFormアプリケーション (6)
NotRealNegativeQ[x_ ? NumberQ] := Head[x] === Complex || x ≥ 0NotRealNegativeQ[-2]Orの引数を評価するとTrueになる場合,続く引数は評価されない:
NotRealNegativeQ[I]Orの引数順は重要である.最後の2引数の順序を入れ替えるとI≥0が評価される:
NotRealNegativeQ2[x_ ? NumberQ] := x ≥ 0 || Head[x] === ComplexNotRealNegativeQ2[I]Refine[Sqrt[(x ^ 2 - 1) ^ 2], x ≤ -1 || x ≥ 1]方程式と不等式を結合する.Orは入力と出力の両方に使われている:
Reduce[x ^ 2 == 1 || x ^ 3 ≤ 1 / 8, x, Reals]RegionPlot[x ^ 2 + y ^ 2 < 1 || x + y > 0, {x, -2, 2}, {y, -2, 2}]RegionPlot3D[x ^ 2 + y ^ 2 + z ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 + z ^ 2 < 1, {x, -1, 2}, {y, -1, 1}, {z, -1, 1}]Orに基づいたセルオートマトン:
ArrayPlot[Boole[CellularAutomaton[{Or@@#&, {}}, {{True}, False}, 20]]]Integrate[Boole[x ^ 2 + y ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 < 2], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]RegionPlot[x ^ 2 + y ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 < 2, {x, -1.5, 2.5}, {y, -2, 2}]特性と関係 (7)
2引数のOrの真理値表:
BooleanTable[{x, y, Or[x, y]}, {x, y}]//Grid3引数のOr:
BooleanTable[{x, y, z, Or[x, y, z]}, {x, y, z}]//GridOr[]1引数のOrは,値にかかわらず,引数を評価して返す:
Or[2 + 2]p || q && r//FullFormBooleanConvertを使ってAndをOrについて展開する:
(a || b) && (c || d || e)BooleanConvert[%]ド・モルガン(De Morgan)の法則はAnd,Or,Notを関連付ける:
BooleanConvert[!(a && b)]BooleanConvert[!(a || b || c)]条件の論理和はBoole関数の最大のもの(Max)に相当する:
Max[Boole[a], Boole[b]] - Boole[a || b]Simplify[%]関連項目
Xor BooleanConvert LogicalExpand BitOr Nor And Not Disjunction Union BooleanCountingFunction AnyTrue
文字: \[Or]
Function Repository: VennDiagram
テクニカルノート
関連するガイド
-
▪
- ブール計算 ▪
- 信頼性解析 ▪
- 言語の概要 ▪
- 論理演算とブール代数 ▪
- 判定式 ▪
- 離散数学 ▪
- 定理証明 ▪
- Wolfram言語のシンタックス
履歴
1988 で導入 (1.0) | 1996 で更新 (3.0)
テキスト
Wolfram Research (1988), Or, Wolfram言語関数, https://reference.wolfram.com/language/ref/Or.html (1996年に更新).
CMS
Wolfram Language. 1988. "Or." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Or.html.
APA
Wolfram Language. (1988). Or. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Or.html
BibTeX
@misc{reference.wolfram_2026_or, author="Wolfram Research", title="{Or}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Or.html}", note=[Accessed: 04-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_or, organization={Wolfram Research}, title={Or}, year={1996}, url={https://reference.wolfram.com/language/ref/Or.html}, note=[Accessed: 04-November-2026]}