propositional-logic

Declarative sentence

  • A declarative sentence (陈述句) is a sentence that aims to declare a fact.

    eg: Today is Saturday.

  • 疑问句/祈使句...(不是)

Proposition

  • A proposition is a declarative sentence that is either true or false.

Propositional Variables

  • Use variables (English letters) to represent propositions.

Truth Value

  • Assigned to propositional variables.

    True: represented by T
    False: represented by F

Propositional Operators

  • Logical negation (indicated by ¬ , ! , or ⁻) 非
  • Logical conjunction (indicated by ∧, &&, or ·) 与 合取
  • Logical disjunction (indicated by ∨, ||, or +) 或 析取
  • Logical exclusive disjunction (indicated by ⊕) 异或

Logical implication (indicated by →)

  • p when q
    img_1

p is the sufficient condition for q; q is the necessary condition for p

* False always true
  • Contrapositive(质位变换命题, 逆否命题:
  • Converse (逆命题):
  • Inverse (否命题):$\neg p \rightarrow \neg q $

Logical bidirectional implication (indicated by ↔)

  • p if and only if q
  • if p then q
    img_2

Compound(复合)Propositions

  • A compound proposition involves a number of propositional variables and logical operators. img_3
    does not mean

Specification Consistency

  • Equivalently, if a specification {} is consistent, then the compound proposition is true for at least one assignment
  • If the specification is inconsistent, then is always false.
    1