10.03.2015 Views

Slide 1 First-order Logic

Slide 1 First-order Logic

Slide 1 First-order Logic

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Kabos: Intro<strong>Logic</strong> slides 25 Oct 2007<br />

✬<br />

✩<br />

<strong>Slide</strong> 1<br />

<strong>First</strong>-<strong>order</strong> <strong>Logic</strong><br />

✫<br />

✬<br />

✪<br />

✩<br />

Predicates and Quantifiers<br />

<strong>Slide</strong> 2<br />

Predicate logic generalizes the grammatical predicate<br />

and relations.<br />

Result of applying a predicate P to an object x is the<br />

proposition P(x).<br />

✫<br />

✬<br />

✪<br />

✩<br />

<strong>Slide</strong> 3<br />

Quantifiers provide a formal notation that allow us<br />

to quantify how many objects in the universe set<br />

satisfy a given predicate.<br />

✫<br />


Kabos: Intro<strong>Logic</strong> slides 25 Oct 2007<br />

✬<br />

✩<br />

<strong>Slide</strong> 4<br />

U: all animals<br />

A(x): x is an alligator<br />

R(x): x is a reptile<br />

Z(x): x lives at the Zoo.<br />

Some reptile lives at the zoo.<br />

∃x (R(x) & Z(x))<br />

✫<br />

✬<br />

✪<br />

✩<br />

<strong>Slide</strong> 5<br />

U: all animals<br />

A(x): x is an alligator<br />

R(x): x is a reptile<br />

Z(x): x lives at the Zoo.<br />

Every alligator is a reptile.<br />

∀x (A(x) → R(x))<br />

✫<br />

✬<br />

✪<br />

✩<br />

<strong>Slide</strong> 6<br />

U: all animals<br />

A(x): x is an alligator<br />

R(x): x is a reptile<br />

Z(x): x lives at the Zoo.<br />

There are reptiles which are<br />

not alligators.<br />

∃x (R(x) & ¬A(x)) ⇐⇒ ¬(∀x (R(x) → A(x)))<br />

✫<br />


Kabos: Intro<strong>Logic</strong> <strong>First</strong>-<strong>order</strong> theories / 1<br />

<strong>First</strong>-<strong>order</strong> theories<br />

Propositional calculus<br />

Syntax<br />

Variable (in Propositional Calculus):<br />

an element of the Universe set {T, F }<br />

List of symbols:<br />

1. variables: A, B, C,...<br />

2. logical constants T, F<br />

3. logical operators: ¬, &, ∨, →, ↔, ...<br />

4. parentheses ( left , right)<br />

Formula: is defined recursively by the rules<br />

1. variable or constant<br />

2. if ϕ is a formula then ¬ϕ is a formula<br />

3. if ϕ and ψ are formulae then ϕ → ψ is a formula<br />

4. nothing else is a formula<br />

<strong>Logic</strong>al axioms:<br />

A1: ϕ → (ψ → ϕ)<br />

A2: (ϕ → (ψ → ρ)) → ((ϕ → ψ) → (ϕ → ρ))<br />

A3: (¬ϕ → ψ) → ((¬ϕ → ¬ψ) → ϕ)<br />

Inference rule Modus Ponens (MP):<br />

if ϕ → ψ and ϕ then ψ<br />

Let S be a set of formulae.<br />

Proof (=formal derivation) of a formula ϕ in S is a sequence<br />

{ϕ 1 , ϕ 2 , ϕ 3 , ϕ 4 , ...ϕ i , ...ϕ} if every ϕ i is either elements of S, or a logical<br />

axiom, or is made from two previous ϕ’s by inference rule Modus Ponens.<br />

S ⊢ ϕ means that ϕ is provable (has a formal derivation in S).<br />

Closure of S : set of all provable formulae in S.


Kabos: Intro<strong>Logic</strong> <strong>First</strong>-<strong>order</strong> theories / 2<br />

Semantics<br />

Interpretation of a formula: substituting values into variables.<br />

A variable takes an element from the universe, and the interpreted formula<br />

takes either T or F<br />

Model of S : an interpretation when all formulae in S are T<br />

S |= ϕ means that ϕ is entailed by S, that is ϕ takes T in every possible<br />

model of S<br />

Soundness: if S ⊢ ϕ then S |= ϕ<br />

Completeness: if S |= ϕ then S ⊢ ϕ<br />

It can be seen, that Propositional <strong>Logic</strong> is sound and complete.<br />

<strong>First</strong>-<strong>order</strong> Calculus<br />

Individual variable: (in <strong>First</strong>-<strong>order</strong> Calculus)<br />

an element of a given Universe set U.<br />

List of symbols:<br />

1. individual variables: x, y, z , ...<br />

2. constants: c,...<br />

3. predicate variables (relations): P, Q, R ...<br />

4. functions: f, g<br />

5. quantifiers, universal: ∀ , existential: ∃<br />

6. logical operators: ¬, &, ∨, →, ↔, ...<br />

7. parentheses ( left , right)<br />

Term: is defined recursively by the rules<br />

1. individual variables and constants are terms,<br />

2. if t 1 , .., t N are terms and f is a function then f(t 1 , t 2 , ..., t N ) is a term,<br />

3. nothing else is a term.<br />

Atomic formula:<br />

If P is a predicate variable andt 1 , t 2 , ..., t N are terms, then P (t 1 , t 2 , ..., t N )<br />

is an atomic formula


Kabos: Intro<strong>Logic</strong> <strong>First</strong>-<strong>order</strong> theories / 3<br />

Formula: is defined recursively by the rules<br />

1. an atomic formula,<br />

2. if ϕ is a formula then ¬ϕ is a formula,<br />

3. if ϕ és ψ are formulae then ϕ → ψ is a formula,<br />

4. if ϕ a formula and x is a variable, then ∀xϕ is formula,<br />

5. nothing else is a formula.<br />

Free and bounded variables:<br />

1. If ϕ is an atomic formula then x is free in ϕ if x occurs in ϕ<br />

2. x is free in ¬ϕ if x is free in ϕ<br />

3. x is free in (ϕ → ϕ) if x is free in ϕ and does not occur in ψ, or x is free<br />

in ψ and does not occur in ϕ, or x is free in both ϕ and ψ<br />

4. x is free in ∀y ϕ if x is free in ϕ and x is a different symbol than y<br />

5. x is bound in ϕ if x occurs in ϕ and x is not free in ϕ<br />

Rules of substitution variables in formulae, valid and invalid substitutions<br />

(omitted here).<br />

Conventions for equality (omitted here).<br />

<strong>Logic</strong>al axioms:<br />

A1-A3 from propositional logic and<br />

A4. omitted, it uses the concept of valid substitutions<br />

A5. (∀x (ϕ → ψ)) −→ (ϕ → ∀x ψ) provided x is not a free variable in ϕ<br />

Sentence:<br />

Theory:<br />

a formula without free variables<br />

a set of sentences S<br />

Proof (=formal derivation) of formula ϕ from S is the same as in<br />

Propositional Calculus but we have an inference rule Universal<br />

Generalisation (in addition to Modus Ponens)<br />

Universal Generalisation:<br />

if S ⊢ ϕ then S ⊢ ∀x ϕ<br />

Closure of S : set of all provable sentences in S<br />

Consistency of S : if ϕ is provable then and ¬ϕ is not.<br />

Completeness of S : if ϕ is not provable then ¬ϕ is provable.<br />

(to be continued)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!