# Applications and Equivalences

https://slides.com/georgelee/ics141-applications-equivalences/live

# What do we use the logics for?

# Translating Into English

# System Specifications

# Sounds pretty boring

http://clientsfromhell.net/

# Automated Testing

Where you write code twice

(once as a test case, once to get the test to pass)

## Consistent Specifications

A system specification that does not contain any contradictions.

# Boolean Searches

~~Boolean Searches~~

# SQL Queries

```
SELECT * FROM users
WHERE status = 1
AND (email = 'test@hawaii.edu' OR email = 'admin@hawaii.edu');
```

# Logic Puzzles

# Logic Circuits

# Tautologies and Contradictions

## Tautology

A compound proposition that is always true, no matter what the values of the propositional variables are.

i.e. p v ¬p

## Contradiction

A compound proposition that is always false, no matter what the values of the propositional variables are.

i.e. p ^ ¬p

## Contingency

A compound proposition that is neither a contradiction nor a tautology (pretty much anything else)

# Logical Equivalences

## Equivalent

Two expressions that have the same truth values in all cases are *logically equivalent.*

Or, let *p *and *q* be two compound propositions, *p* and *q* are logically equivalent if *p*↔*q* is a tautology.

Sometimes denoted as ≡* *

# List of Equivalences

# There's Too Many!

## Refer to Tables 6, 7, 8 on pages 27-28

## DeMorgan's Laws

- ¬(p ^ q) ≡ ¬p v ¬q
- ¬(p v q) ≡ ¬p ^ ¬q

#### Applications and Equivalences

By George Lee

# Applications and Equivalences

- 1,046