# AIMA: First-Order Logic

> Source: https://ollybritton.com/notes/textbooks/ai-a-modern-approach/knowledge-reasoning-and-planning/first-order-logic/ · Updated: 2021-04-04 · Tags: notes, aima

## Flashcards
##### What is the Sapir-Whorf hypothesis??
Our understanding of the world is strongly influenced by the language we speak.

##### What three things does first-order logic assume exists in the world??
1. Facts
2. Objects
3. Relations

##### What one thing does propositional logic assume exists in the world??
Facts

##### What are the ontological commitments of a logic??
What it assumes about how reality is constructed.

##### What is a relation in first-order logic??
Some relationship or property expressed by one or more objects.

##### What's a more natural way of thinking about unary relations??
Properties of an object.

##### What's an example of a unary relation??
* $\text{Smelly}(\text{Zain})$
* $\text{Green}(\text{Grass})$

##### What's an example of a binary relation??
* $\text{Head}(\text{Bob's Head}, \text{Bob})$

##### $$P(x, y)$$ How can you read a binary relation like this??
$x$ is a $P$ of $y$.

##### What is the arity of a relation??
The number of objects it connects.

##### What is a function in first-order logic??
A shorthand for representing the only existing related object for many-to-one relations.

##### Why is $\text{LeftLeg}(\text{Charlie})$ a valid function in first-order logic??
Because the relation $\text{LeftLeg}$ is many-to-one.

##### Why is the notation for functions and relations such as $\text{YoungestSibling}(\text{Bob})$ confusing??
Because it can represent two differet things:

1. The sentence "Bob has a youngest sibling"
2. The term representing Bob's youngest sibling

##### Why are functions used in first-order logic??
Because they mean you don't have to name every single object.

##### What is the symbol for universal quantification??
$$
\forall
$$

##### $$\forall x\, ...$$ How can you pronounce something like this??
"For all $x$..."

##### How would you write the sentence that every $\text{King}$ is a $\text{Person}$ in first-order logic??
$$
\forall x\, \text{King}(x) \implies \text{Person}(x)
$$

##### What is the symbol for existential quantification??
$$
\exists
$$

##### $$\exists x\, ...$$ How can you pronounce something like this??
"There exists at least one $x$..."

##### How would you write the sentence that there exists at least one $\text{Crown}$ that is also on $\text{John's}$ head??
$$
\exists x\, \text{Crown}(x) \land \text{OnHead}(x, \text{John})
$$

##### $$\neg \exists x P$$ Can you rewrite using this a universal quantifier??
$$
\forall x\,\neg P
$$

##### $$\neg \forall x P$$ Can you rewrite this using an existential quantifier??
$$
\exists x\, \neg P
$$

##### $$\exists x P$$ Can you rewrite this using a universal quantifier??
$$
\neg \forall x\, \neg P
$$

##### $$\forall x P$$ Can you rewrite this using an existential quantifier??
$$
\neg \exists x\, \neg P
$$

---
Olly Britton — https://ollybritton.com. Machine-readable index: https://ollybritton.com/llms.txt
