INFO I308: 2 Logic, Sets, and Relations

Transition from Primitive Data

Logic

Propositional Calculus

  1. WFF's (well-formed formulas) are a language.
  2. Propositions are true or false.
  3. Propositional variables and constants.
  4. The operators and, or, not
  5. Truth tables
  6. Proofs, rules of inference

See Coursepack, section 5.2.1

Predicate Calculus

  1. Builds on propositional calculus
  2. Predicates/relations
  3. Individual variables and constants represent entities
  4. Quantifiers
  5. Additional rules of inference

See Coursepack, section 5.2.2

Prolog

  1. Programming language based on predicate calculus
  2. Facts and rules
  3. Proofs
  4. Closed world assumption
    1. If something is not stated or implied, it's assumed to be false.
    2. Equivalently, Prolog queries tell us what is provable from the knowledge base, not what's independently true or false

See Coursepack, section 5.7.

Prolog Examples

Limitations of Logic

Logic alone cannot represent:

Still, it's a good foundation for much of information representation.

Sets

See Coursepack, section 2.1

Relations

Facts of same predicate—

father(bill, bob, 1950).
father(andy, joy, 1960).
father(hal, judy, 1970).
father(bob, bill, 1980).

—can be shown as a table:

Father       Child            Year
-------      ---------        -------
Bill         Bob              1950
Andy         Joy              1960
Hal          Judy             1970
Bob          Bill             1980

Facts, No Rules

Relational Model for Databases

See Coursepack, sections 2.2–2.8

Table Operations

Relational algebra studies relations and their operations.

Querying Databases with Relational Algebra

See Coursepack