Applied LogicUnit 38 min read

Symbolic Logic: Propositions, Connectives & Truth Tables

Unit 3 of Applied Logic teaches how to translate natural language arguments into symbolic logic using propositional variables, logical connectives (AND, OR, NOT, IMPLIES), and truth tables to evaluate validity. Covers tautologies, contradictions, and logical equivalences with real-world applications in programming, AI,

What is Symbolic Logic?

Symbolic logic is a formal system that uses symbols and precise rules to represent and analyze logical relationships. Unlike natural language, which can be ambiguous, symbolic logic provides a clear, unambiguous way to express arguments.

Key Components:

  1. Propositional Variables: Represented by letters (e.g., ), these stand for statements that can be true or false.
  2. Logical Connectives: Symbols that connect propositions to form complex statements.
  3. Truth Tables: Tables that show all possible truth values of a compound proposition.

Propositional Variables and Logical Connectives

Propositional variables are the building blocks of symbolic logic. They are simple statements that can be assigned a truth value (true or false).

Example:

  • Let : "It is raining."
  • Let : "I will carry an umbrella."

Logical Connectives:

Connective Symbol Name Example (Natural Language) Example (Symbolic)
Negation NOT "It is not raining."
Conjunction AND "It is raining and I will carry an umbrella."
Disjunction OR "It is raining or I will carry an umbrella."
Implication IMPLIES "If it is raining, then I will carry an umbrella."
Biconditional IF AND ONLY IF "I will carry an umbrella if and only if it is raining."

Truth Tables

Truth tables systematically list all possible truth values of propositions and their combinations. They are essential for evaluating the validity of logical arguments.

Example: Truth Table for

T T T
T F F
F T F
F F F

Constructing a Truth Table:

  1. List all possible truth values for the propositional variables.
  2. Evaluate the truth value of each sub-expression step-by-step.
  3. Combine the results to find the final truth value.

Evaluating Compound Propositions

Compound propositions are formed by combining simpler propositions using logical connectives. Truth tables help determine whether a compound proposition is a tautology, contradiction, or contingency.

Types of Compound Propositions:

  1. Tautology: Always true (e.g., ).
  2. Contradiction: Always false (e.g., ).
  3. Contingency: Can be true or false depending on the truth values of its components (e.g., ).

Logical Equivalences

Logical equivalences are statements that have the same truth value in all possible scenarios. They are useful for simplifying complex logical expressions.

Common Logical Equivalences:

Name Equivalence
Double Negation
Commutative Laws
Associative Laws
Distributive Laws
De Morgan’s Laws
Implication Equivalence
Biconditional Equivalence

Real-World Applications of Symbolic Logic

Symbolic logic is widely used in computer science, artificial intelligence, and everyday decision-making.

1. Programming and Software Development

  • Conditionals in Code: Logical connectives are used in programming to create conditional statements (e.g., if-else in Python, Java).
    if p and q:  # Equivalent to \( p \land q \)
        print("Both conditions are true")
    
  • Boolean Algebra: Used in designing digital circuits and hardware logic gates.

2. Artificial Intelligence and Machine Learning

  • Rule-Based Systems: AI systems use logical rules to make decisions (e.g., expert systems in medical diagnosis).
  • Natural Language Processing (NLP): Symbolic logic helps in parsing and understanding human language.

3. Database Queries

  • SQL Queries: Logical operators (AND, OR, NOT) are used to filter data in databases.
    SELECT * FROM Customers WHERE Country = 'Nepal' AND Age > 18;
    

4. E-Commerce and Decision-Making

  • Discount Rules: Websites like Daraz use logical conditions to apply discounts (e.g., "Buy 2 items AND spend over Rs. 5000 to get 10% off").
  • Fraud Detection: Banks use logical rules to detect fraudulent transactions (e.g., "If transaction amount > Rs. 100,000 AND location is different from usual, flag as suspicious").

Worked Example: Daraz Order Processing

Suppose Daraz has the following rules for order processing:

  • If an order is placed and the payment is confirmed, then the order is processed.
  • If the order is processed or the customer cancels, then the order status is updated.

Let:

  • : Order is placed.
  • : Payment is confirmed.
  • : Order is processed.
  • : Customer cancels.

The rules can be symbolized as:

  1. Update order status.

Using truth tables, Daraz can automate the decision-making process for order processing and status updates.


Exam Tip

For the TU exam on Symbolic Logic, focus on the following:

  1. Understand the Basics: Know the symbols for logical connectives and how to construct truth tables.
  2. Practice Truth Tables: Be able to evaluate any compound proposition using truth tables.
  3. Logical Equivalences: Memorize common equivalences like De Morgan’s Laws and practice applying them.
  4. Real-World Applications: Relate logical concepts to programming, AI, and decision-making scenarios.
  5. Tautologies and Contradictions: Identify whether a given proposition is a tautology, contradiction, or contingency.
  6. Symbolic Representation: Translate natural language statements into symbolic logic accurately.

Common Mistakes to Avoid:

  • Forgetting to list all possible truth values in a truth table.
  • Misapplying logical equivalences (e.g., confusing and in De Morgan’s Laws).
  • Overcomplicating symbolic representations of natural language statements.

logic gates and truth table labelled diagramA labelled diagram showing AND, OR, NOT gates and their corresponding truth tables. (Image: Chemsaint, CC BY-SA 4.0, via Wikimedia Commons)

classDiagram
    class Proposition {
        +isTrue(): boolean
    }
    class Connective {
        <<abstract>>
        +evaluate(p1: boolean, p2: boolean): boolean
    }
    class AND {
        +evaluate(p1: boolean, p2: boolean): boolean
    }
    class OR {
        +evaluate(p1: boolean, p2: boolean): boolean
    }
    class NOT {
        +evaluate(p: boolean): boolean
    }
    class IMPLIES {
        +evaluate(p: boolean, q: boolean): boolean
    }
    Proposition "1" -- "1" Connective : uses
    Connective <|-- AND
    Connective <|-- OR
    Connective <|-- NOT
    Connective <|-- IMPLIES
flowchart TD
    A["Propositional Variables (p, q, r)"] --> B["Logical Connectives (¬, ∧, ∨, →, ↔)"]
    B --> C["Construct Truth Table"]
    C --> D["Evaluate Compound Proposition"]
    D --> E["Determine Tautology/Contradiction/Contingency"]
    E --> F["Apply Logical Equivalences"]
    F --> G["Simplify or Transform Expressions"]

Based on the TU BSc CSIT syllabus for Applied Logic, unit 3.

Discussion

Loading…