Logic 使用或不使用创建和表达式
对于赋值,我必须编写一个布尔公式,等价于:Logic 使用或不使用创建和表达式,logic,operators,operator-keyword,Logic,Operators,Operator Keyword,对于赋值,我必须编写一个布尔公式,等价于: X = (A > 10) & (A < 20) 不会起作用,因为这永远都是事实。我尝试了一些其他的选择,但没有一个会给出与第一个公式相同的结果。那么,这是可能的吗?感谢奥卡萨,事实上是摩根定律 不(不是(a>10)或不(a感谢Ocasa,事实上是摩根定律 not(not(a>10)或not(a在经典逻辑中,以下等价关系成立: ¬¬P ≡ P (Double Negation) ¬(P ∧ Q) ≡ ¬P
X = (A > 10) & (A < 20)
不会起作用,因为这永远都是事实。我尝试了一些其他的选择,但没有一个会给出与第一个公式相同的结果。那么,这是可能的吗?感谢奥卡萨,事实上是摩根定律
不(不是(a>10)或不(a感谢Ocasa,事实上是摩根定律
not(not(a>10)或not(a在经典逻辑中,以下等价关系成立:
¬¬P ≡ P (Double Negation)
¬(P ∧ Q) ≡ ¬P ∨ ¬Q (De Morgan's Law 1)
¬(P ∨ Q) ≡ ¬P ∧ ¬Q (De Morgan's Law 2)
因此:
P ∧ Q
≡ ¬¬(P ∧ Q) (Double Negation Introduction)
≡ ¬(¬P ∨ ¬Q) (De Morgan's Law 1)
就你而言,我们有:
(N > 10) ∧ (N < 20)
≡ ¬¬((N > 10) ∧ (N < 20)) (Double Negation Introduction)
≡ ¬(¬(N > 10) ∨ ¬(N < 20)) (De Morgan's Law 1)
≡ ¬(N ≤ 10 ∨ N ≥ 20) (Trichotomy)
(N>10)∧ (N<20)
≡ (N>10)∧ (N<20))(双重否定介绍)
≡ (N>10)∨ ((N<20))(德摩根定律1)
≡ (N)≤ 10∨ N≥ 20) (三分法)
以下等价物在经典逻辑中适用:
¬¬P ≡ P (Double Negation)
¬(P ∧ Q) ≡ ¬P ∨ ¬Q (De Morgan's Law 1)
¬(P ∨ Q) ≡ ¬P ∧ ¬Q (De Morgan's Law 2)
因此:
P ∧ Q
≡ ¬¬(P ∧ Q) (Double Negation Introduction)
≡ ¬(¬P ∨ ¬Q) (De Morgan's Law 1)
就你而言,我们有:
(N > 10) ∧ (N < 20)
≡ ¬¬((N > 10) ∧ (N < 20)) (Double Negation Introduction)
≡ ¬(¬(N > 10) ∨ ¬(N < 20)) (De Morgan's Law 1)
≡ ¬(N ≤ 10 ∨ N ≥ 20) (Trichotomy)
(N>10)∧ (N<20)
≡ (N>10)∧ (N<20))(双重否定介绍)
≡ (N>10)∨ ((N<20))(德摩根定律1)
≡ (N)≤ 10∨ N≥ 20) (三分法)
您可以使用&&operator吗?不,只能使用或不使用XOR,但文字提示是;使用或不使用&&operator吗?不,只能使用或不使用XOR,但文字提示是;使用或不使用