For faster navigation, this Iframe is preloading the Wikiwand page for 逻辑或.

逻辑或

文氏图

逻辑或(logical or)又称逻辑析取(logical disjunction)、逻辑选言,是逻辑数学概念中的一个二元逻辑算符。其运算方法是:如果其两个变量中有一个真值为“真”,其结果为“真”,两个变量同时为假,其结果为“假”。

定义

逻辑或是两个逻辑变量的一种运算,经常是两个命题的运算。它满足:当且仅当其两个变量的真值都为假时,其结果为假。

真值表

A或B的真值表(也写作AB(逻辑学),A || B(计算机科学),或A + B(电子学))。

A B
F T
F F T
T T T

性质

逻辑或满足以下性质:

  • 结合律:
  • 交换律:
  • 分配律:
  • 幂等律:
  • 单调性:
  • 保真性: 所有变量的真值皆为“真”的命题在逻辑或运算后的结果为真。
  • 保假性: 所有变量的真值皆为“假”的命题在逻辑或运算后的结果为假。

计算机科学中的运用

位运算

逻辑或常在位运算中使用,比如:

  • 0 or 0 = 0
  • 0 or 1 = 1
  • 1 or 0 = 1
  • 1 or 1 = 1
  • 1100 or 1010 = 1110

or运算符可以用来将比特域中的位设定为1,方法是把此域和一个各位均为1的常量域取逻辑或运算。

编程中的使用

逻辑运算

并集运算

xAB⇔( 当且仅当) (xA) ∨ (xB).

自然语言

就如其他在数理逻辑中形式化的概念一般,自然语言中的“或”和逻辑的“或”高度相关,但有差异。像例如在“你给我打电话,或者寄信给我”这例子中,其真实的意思往往是“你要不就给我打电话,要不就给我寄信,但不要同时寄信和打电话。”,也就是会排除掉两者皆成立的状况;在另一方面,在“小橘子姐姐开赛车的驾驶技术神乎其技,因此她很努力,或者她很有天分”这例子中,两者皆成立的状况通常并未排除。也就是说,在自然语言中,“或”可以指“逻辑或”,或者是“逻辑异或”。

注释

参见

相关网页

{{bottomLinkPreText}} {{bottomLinkText}}
逻辑或
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?