SoftwareEngineering

ド・モルガンの定義

example for VBA

Public Sub TestDeMorgan()
    Call DeMorgan(False, False)
    Call DeMorgan(False, True)
    Call DeMorgan(True, False)
    Call DeMorgan(True, True)
End Sub

Private Sub DeMorgan(ByVal A As Boolean, ByVal B As Boolean)
    Debug.Assert (Not A And Not B) = Not (A Or B)
    Debug.Assert (Not A And B) = Not (A Or Not B)
    Debug.Assert (A And Not B) = Not (Not A Or B)
    Debug.Assert (A And B) = Not (Not A Or Not B)

    Debug.Assert (Not A Or Not B) = Not (A And B)
    Debug.Assert (Not A Or B) = Not (A And Not B)
    Debug.Assert (A Or Not B) = Not (Not A And B)
    Debug.Assert (A Or B) = Not (Not A And Not B)
End Sub

トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-07-03 (水) 23:00:16 (48d)