Irving Copi & Carl Cohen, Introduction to Logic, 10th edition (Prentice Hall, 1998).


Some different types of logics that are of importance to computer science
* Propositional/Boolean logic: the design of combinatorial electronic circuits; program control
* Predicate logic: formal specification, prolog programming language
* Higher-order logic (e.g., second order logic): formal verification of hardware
* Sequential/temporal logic: design of computer memory; program concurrency
* Intensional logic: natural language processing; human-computer interaction


Propositional Logic 


A proposition is a statement that can be true or false. Propositional logic uses true statements to form or prove other true statements.

There are two parts to propositional logic:

A simple statement (atomic proposition) is one that does not contain any other statement as a part. We will use the lower-case letters, p, q, r, ..., as symbols for simple statements.

A compound statement (compound proposition) is one with two or more simple statements as parts or what we will call components. A component of a compound is any whole statement that is part of a larger statement; components may themselves be compounds.

An operator (or connective) joins simple statements into compounds, and joins compounds into larger compounds. We will use the symbols, , · , , and to designate the sentential connectives. They are called sentential connectives because they join sentences (or what we are calling statements). The symbol, ~, is the only operator that is not a connective; it affects single statements only, and does not join statements into compounds.

The symbols for statements and for operators comprise our notation or symbolic language. Parentheses serve as punctuation.

Simple statements

p "p is true" assertion
~p "p is false" negation

Compounds and connectives

p q "either p is true, or q is true, or both" disjunction
p · q "both p and q are true" conjunction
p q "if p is true, then q is true" implication
p q "p and q are either both true or both false" equivalence

Implication statements (p q) are sometimes called conditionals, and equivalence statements (p q) are sometimes called biconditionals.


Representation:

Reasoning: