Introduction to Logic Programming Foundations, First-Order Language - - PowerPoint PPT Presentation

introduction to logic programming
SMART_READER_LITE
LIVE PREVIEW

Introduction to Logic Programming Foundations, First-Order Language - - PowerPoint PPT Presentation

Introduction to Logic Programming Foundations, First-Order Language Temur Kutsia Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at What is a Logic Program Logic program is a set of certain


slide-1
SLIDE 1

Introduction to Logic Programming

Foundations, First-Order Language Temur Kutsia

Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at

slide-2
SLIDE 2

What is a Logic Program

Logic program is a set of certain formulas of a first-order language. In this lecture: syntax and semantics of a first-order language.

slide-3
SLIDE 3

Introductory Examples

Representing “John loves Mary”: loves(John, Mary). loves: a binary predicate (relation) symbol. Intended meaning: The object in the first argument of loves loves the object in its second argument. John, Mary: constants. Intended meaning: To denote persons John and Mary, respectively.

slide-4
SLIDE 4

Introductory Examples

father: A unary function symbol. Intended meaning: The father of the object in its argument. John’s father loves John: loves(father(John), John).

slide-5
SLIDE 5

First-Order Language

Syntax Semantics

slide-6
SLIDE 6

Syntax

Alphabet Terms Formulas

slide-7
SLIDE 7

Alphabet

A first-order alphabet consists of the following disjoint sets of symbols:

◮ A countable set of variables V. ◮ For each n ≥ 0, a set of n-ary function symbols Fn.

Elements of F0 are called constants.

◮ For each n ≥ 0, a set of n-ary predicate symbols Pn. ◮ Logical connectives ¬, ∨, ∧, ⇒, ⇔. ◮ Quantifiers ∃, ∀. ◮ Parenthesis ‘(’, ‘)’, and comma ‘,’.

slide-8
SLIDE 8

Alphabet

A first-order alphabet consists of the following disjoint sets of symbols:

◮ A countable set of variables V. ◮ For each n ≥ 0, a set of n-ary function symbols Fn.

Elements of F0 are called constants.

◮ For each n ≥ 0, a set of n-ary predicate symbols Pn. ◮ Logical connectives ¬, ∨, ∧, ⇒, ⇔. ◮ Quantifiers ∃, ∀. ◮ Parenthesis ‘(’, ‘)’, and comma ‘,’.

Notation:

◮ x, y, z for variables. ◮ f, g for function symbols. ◮ a, b, c for constants. ◮ p, q for predicate symbols.

slide-9
SLIDE 9

Terms

Definition

◮ A variable is a term. ◮ If t1, . . . , tn are terms and f ∈ Fn, then f(t1, . . . , tn) is a term. ◮ Nothing else is a term.

slide-10
SLIDE 10

Terms

Definition

◮ A variable is a term. ◮ If t1, . . . , tn are terms and f ∈ Fn, then f(t1, . . . , tn) is a term. ◮ Nothing else is a term.

Notation:

◮ s, t, r for terms.

slide-11
SLIDE 11

Terms

Definition

◮ A variable is a term. ◮ If t1, . . . , tn are terms and f ∈ Fn, then f(t1, . . . , tn) is a term. ◮ Nothing else is a term.

Notation:

◮ s, t, r for terms.

Example

◮ plus(plus(x, 1), x) is a term, where plus is a binary function

symbol, 1 is a constant, x is a variable.

slide-12
SLIDE 12

Terms

Definition

◮ A variable is a term. ◮ If t1, . . . , tn are terms and f ∈ Fn, then f(t1, . . . , tn) is a term. ◮ Nothing else is a term.

Notation:

◮ s, t, r for terms.

Example

◮ plus(plus(x, 1), x) is a term, where plus is a binary function

symbol, 1 is a constant, x is a variable.

◮ father(father(John)) is a term, where father is a unary

function symbol and John is a constant.

slide-13
SLIDE 13

Formulas

Definition

◮ If t1, . . . , tn are terms and p ∈ Pn, then p(t1, . . . , tn) is a

  • formula. It is called an atomic formula.

◮ If A is a formula, (¬A) is a formula. ◮ If A and B are formulas, then (A ∨ B), (A ∧ B), (A ⇒ B), and

(A ⇔ B) are formulas.

◮ If A is a formula, then (∃x.A) and (∀x.A) are formulas. ◮ Nothing else is a formula.

slide-14
SLIDE 14

Formulas

Definition

◮ If t1, . . . , tn are terms and p ∈ Pn, then p(t1, . . . , tn) is a

  • formula. It is called an atomic formula.

◮ If A is a formula, (¬A) is a formula. ◮ If A and B are formulas, then (A ∨ B), (A ∧ B), (A ⇒ B), and

(A ⇔ B) are formulas.

◮ If A is a formula, then (∃x.A) and (∀x.A) are formulas. ◮ Nothing else is a formula.

Notation:

◮ A, B for formulas.

slide-15
SLIDE 15

Eliminating Parentheses

◮ Excessive use of parentheses often can be avoided by

introducing binding order.

◮ ¬, ∀, ∃ bind stronger than ∨. ◮ ∨ binds stronger than ∧. ◮ ∧ binds stronger than ⇒ and ⇔. ◮ Furthermore, omit the outer parentheses and associate

∨, ∧, ⇒, ⇔ to the right.

slide-16
SLIDE 16

Eliminating Parentheses

Example

The formula (∀y.(∀x.((p(x)) ∧ (¬r(y))) ⇒ ((¬q(x)) ∨ (A ∨ B))))) due to binding order can be rewritten into (∀y.(∀x.(p(x) ∧ ¬r(y) ⇒ ¬q(x) ∨ (A ∨ B)))) which thanks to the convention of the association to the right and omitting the outer parentheses further simplifies to ∀y.∀x.(p(x) ∧ ¬r(y) ⇒ ¬q(x) ∨ A ∨ B).

slide-17
SLIDE 17

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-18
SLIDE 18

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

∀x.(rational(x) ⇒ real(x)) Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-19
SLIDE 19

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

∀x.(rational(x) ⇒ real(x))

  • 2. There exists a number that is prime.

Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-20
SLIDE 20

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

∀x.(rational(x) ⇒ real(x))

  • 2. There exists a number that is prime.

∃x. prime(x) Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-21
SLIDE 21

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

∀x.(rational(x) ⇒ real(x))

  • 2. There exists a number that is prime.

∃x. prime(x)

  • 3. For every number x, there exists a number y such that

x < y. Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-22
SLIDE 22

Example

Translating English sentences into first-order logic formulas:

  • 1. Every rational number is a real number.

∀x.(rational(x) ⇒ real(x))

  • 2. There exists a number that is prime.

∃x. prime(x)

  • 3. For every number x, there exists a number y such that

x < y. ∀x. ∃y. x < y Assume:

◮ rational, real, prime: unary predicate symbols. ◮ <: binary predicate symbol.

slide-23
SLIDE 23

Example

Translating English sentences into first-order logic formulas: For each natural number there exists exactly one immediate successor natural number. Assume:

◮ succ: binary predicate symbol for immediate successor. ◮ .

=: binary predicate symbol for equality.

slide-24
SLIDE 24

Example

Translating English sentences into first-order logic formulas: For each natural number there exists exactly one immediate successor natural number. ∀x.(∃y.succ(x, y) ∧ ∀z.(succ(x, z) ⇒ y . = z))) Assume:

◮ succ: binary predicate symbol for immediate successor. ◮ .

=: binary predicate symbol for equality.

slide-25
SLIDE 25

Example

Translating English sentences into first-order logic formulas: There is no natural number whose immediate successor is 0. Assume:

◮ zero: constant for 0. ◮ succ: binary predicate symbol for immediate successor.

slide-26
SLIDE 26

Example

Translating English sentences into first-order logic formulas: There is no natural number whose immediate successor is 0. ¬∃x. succ(x, zero) Assume:

◮ zero: constant for 0. ◮ succ: binary predicate symbol for immediate successor.

slide-27
SLIDE 27

Semantics

Meaning of a first-order language consists of an universe and an appropriate meaning of each symbol. This pair is called structure. Structure fixes interpretation of function and predicate symbols. Meaning of variables is determined by a variable assignment. Interpretation of terms and formulas.

slide-28
SLIDE 28

Structure

Structure: a pair (D, I). D is a nonempty universe, the domain of interpretation. I is an interpretation function defined on D that fixes the meaning of each symbol associating

◮ to each f ∈ Fn an n-ary function fI : Dn → D,

(in particular, cI ∈ D for each constant c)

◮ to each p ∈ Pn different from .

=, an n-ary relation pI on D.

slide-29
SLIDE 29

Variable Assignment

A structure S = (D, I) is given. Variable assignment σS maps each x ∈ V into an element of D: σS(x) ∈ D. Given a variable x, an assignment ϑS is called an x-variant of σS iff ϑS(y) = σS(y) for all y = x.

slide-30
SLIDE 30

Interpretation of Terms

A structure S = (D, I) and a variable assignment σS are given.

slide-31
SLIDE 31

Interpretation of Terms

A structure S = (D, I) and a variable assignment σS are given. Value of a term t under S and σS, ValS,σS(t):

◮ ValS,σS(x) = σS(x). ◮ ValS,σS(f(t1, . . . , tn)) = fI(ValS,σS(t1), . . . , ValS,σS(tn)).

slide-32
SLIDE 32

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given.

slide-33
SLIDE 33

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Value of an atomic formula under S and σS is one of true, false:

slide-34
SLIDE 34

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Value of an atomic formula under S and σS is one of true, false:

◮ ValS,σS(s .

= t) = true iff ValS,σS(s) = ValS,σS(t).

slide-35
SLIDE 35

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Value of an atomic formula under S and σS is one of true, false:

◮ ValS,σS(s .

= t) = true iff ValS,σS(s) = ValS,σS(t).

◮ ValS,σS(p(t1, . . . , tn)) = true iff

(ValS,σS(t1), . . . , ValS,σS(tn)) ∈ pI.

slide-36
SLIDE 36

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given.

slide-37
SLIDE 37

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

slide-38
SLIDE 38

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false.

slide-39
SLIDE 39

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

slide-40
SLIDE 40

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

◮ ValS,σS(A ∧ B) = true iff

ValS,σS(A) = true and ValS,σS(B) = true.

slide-41
SLIDE 41

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

◮ ValS,σS(A ∧ B) = true iff

ValS,σS(A) = true and ValS,σS(B) = true.

◮ ValS,σS(A ⇒ B) = true iff

ValS,σS(A) = false or ValS,σS(B) = true.

slide-42
SLIDE 42

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

◮ ValS,σS(A ∧ B) = true iff

ValS,σS(A) = true and ValS,σS(B) = true.

◮ ValS,σS(A ⇒ B) = true iff

ValS,σS(A) = false or ValS,σS(B) = true.

◮ ValS,σS(A ⇔ B) = true iff ValS,σS(A) = ValS,σS(B).

slide-43
SLIDE 43

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

◮ ValS,σS(A ∧ B) = true iff

ValS,σS(A) = true and ValS,σS(B) = true.

◮ ValS,σS(A ⇒ B) = true iff

ValS,σS(A) = false or ValS,σS(B) = true.

◮ ValS,σS(A ⇔ B) = true iff ValS,σS(A) = ValS,σS(B). ◮ ValS,σS(∃x.A) = true iff

ValS,ϑS(A) = true for some x-variant ϑS of σS.

slide-44
SLIDE 44

Interpretation of Formulas

A structure S = (D, I) and a variable assignment σS are given. Values of compound formulas under S and σS are also either true or false:

◮ ValS,σS(¬A) = true iff ValS,σS(A) = false. ◮ ValS,σS(A ∨ B) = true iff

ValS,σS(A) = true or ValS,σS(B) = true.

◮ ValS,σS(A ∧ B) = true iff

ValS,σS(A) = true and ValS,σS(B) = true.

◮ ValS,σS(A ⇒ B) = true iff

ValS,σS(A) = false or ValS,σS(B) = true.

◮ ValS,σS(A ⇔ B) = true iff ValS,σS(A) = ValS,σS(B). ◮ ValS,σS(∃x.A) = true iff

ValS,ϑS(A) = true for some x-variant ϑS of σS.

◮ ValS,σS(∀x.A) = true iff

ValS,ϑS(A) = true for all x-variants ϑS of σS.

slide-45
SLIDE 45

Interpretation of Formulas

A structure S = (D, I) is given.

slide-46
SLIDE 46

Interpretation of Formulas

A structure S = (D, I) is given. The value of a formula A under S is either true or false:

◮ ValS(A) = true iff ValS, σS(A) = true for all σS.

slide-47
SLIDE 47

Interpretation of Formulas

A structure S = (D, I) is given. The value of a formula A under S is either true or false:

◮ ValS(A) = true iff ValS, σS(A) = true for all σS.

S is called a model of A iff ValS(A) = true.

slide-48
SLIDE 48

Interpretation of Formulas

A structure S = (D, I) is given. The value of a formula A under S is either true or false:

◮ ValS(A) = true iff ValS, σS(A) = true for all σS.

S is called a model of A iff ValS(A) = true. Written S A.

slide-49
SLIDE 49

Example

Formula: ∀x.(p(x) ⇒ q(f(x), a)).

slide-50
SLIDE 50

Example

Formula: ∀x.(p(x) ⇒ q(f(x), a)). Define S = (D, I) as

◮ D = {1, 2}, ◮ aI = 1, ◮ fI(1) = 2, fI(2) = 1, ◮ pI = {2}, ◮ qI = {(1, 1), (1, 2), (2, 2)}.

slide-51
SLIDE 51

Example

Formula: ∀x.(p(x) ⇒ q(f(x), a)). Define S = (D, I) as

◮ D = {1, 2}, ◮ aI = 1, ◮ fI(1) = 2, fI(2) = 1, ◮ pI = {2}, ◮ qI = {(1, 1), (1, 2), (2, 2)}.

If σS(x) = 1, then ValS,σS(∀x.(p(x) ⇒ q(f(x), a))) = true.

slide-52
SLIDE 52

Example

Formula: ∀x.(p(x) ⇒ q(f(x), a)). Define S = (D, I) as

◮ D = {1, 2}, ◮ aI = 1, ◮ fI(1) = 2, fI(2) = 1, ◮ pI = {2}, ◮ qI = {(1, 1), (1, 2), (2, 2)}.

If σS(x) = 1, then ValS,σS(∀x.(p(x) ⇒ q(f(x), a))) = true. If σS(x) = 2, then ValS,σS(∀x.(p(x) ⇒ q(f(x), a))) = true.

slide-53
SLIDE 53

Example

Formula: ∀x.(p(x) ⇒ q(f(x), a)). Define S = (D, I) as

◮ D = {1, 2}, ◮ aI = 1, ◮ fI(1) = 2, fI(2) = 1, ◮ pI = {2}, ◮ qI = {(1, 1), (1, 2), (2, 2)}.

If σS(x) = 1, then ValS,σS(∀x.(p(x) ⇒ q(f(x), a))) = true. If σS(x) = 2, then ValS,σS(∀x.(p(x) ⇒ q(f(x), a))) = true. Hence, S A.

slide-54
SLIDE 54

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A.

slide-55
SLIDE 55

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S.

slide-56
SLIDE 56

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa.

slide-57
SLIDE 57

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas.

slide-58
SLIDE 58

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A1, . . . , An}, just formulate them for A1 ∧ · · · ∧ An.

slide-59
SLIDE 59

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A1, . . . , An}, just formulate them for A1 ∧ · · · ∧ An.

Formulas

slide-60
SLIDE 60

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A1, . . . , An}, just formulate them for A1 ∧ · · · ∧ An.

Valid Non-valid

slide-61
SLIDE 61

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A1, . . . , An}, just formulate them for A1 ∧ · · · ∧ An.

Valid Non-valid Satisfiable Unsat

slide-62
SLIDE 62

Validity, Unsatisfiability

A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then ¬A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A1, . . . , An}, just formulate them for A1 ∧ · · · ∧ An.

Valid Non-valid sat Unsat

slide-63
SLIDE 63

Validity, Unsatisfiability

Valid Non-valid sat Unsat

◮ ∀x.p(x) ⇒ ∃y.p(y) is valid. ◮ p(a) ⇒ ¬∃x.p(x) is satisfiable non-valid. ◮ ∀x.p(x) ∧ ∃y.¬p(y) is unsatisfiable.

slide-64
SLIDE 64

Logical Consequence

Definition

A formula A is a logical consequence of the formulas B1, . . . , Bn, if every model of B1 ∧ · · · ∧ Bn is a model of A.

slide-65
SLIDE 65

Logical Consequence

Definition

A formula A is a logical consequence of the formulas B1, . . . , Bn, if every model of B1 ∧ · · · ∧ Bn is a model of A.

Example

◮ mortal(socrates) is a logical consequence of

∀x.(person(x) ⇒ mortal(x)) and person(socrates).

◮ cooked(apple) is a logical consequence of

∀x.(¬cooked(x) ⇒ tasty(x)) and ¬tasty(apple).

◮ genius(einstein) is not a logical consequence of

∃x.person(x) ∧ genius(x) and person(einstein).

slide-66
SLIDE 66

Logic Programs

Logic programs: finite non-empty sets of formulas of a special form, called program clauses.

slide-67
SLIDE 67

Logic Programs

Logic programs: finite non-empty sets of formulas of a special form, called program clauses. Program clause: ∀x1. . . . ∀xk. B1 ∧ · · · ∧ Bn ⇒ A, where

◮ k, n ≥ 0, ◮ A and the B’s are atomic formulas, ◮ x1, . . . , xk are all the variables which occur in A, B1, . . . , Bn.

slide-68
SLIDE 68

Logic Programs

Logic programs: finite non-empty sets of formulas of a special form, called program clauses. Program clause: ∀x1. . . . ∀xk. B1 ∧ · · · ∧ Bn ⇒ A, where

◮ k, n ≥ 0, ◮ A and the B’s are atomic formulas, ◮ x1, . . . , xk are all the variables which occur in A, B1, . . . , Bn.

Usually written in the inverse implication form without quantifiers and conjunctions: A ⇐ B1, . . . , Bn

slide-69
SLIDE 69

Goal

Goals or queries of logic programs: formulas of the form ∃x1. . . . ∃xk. B1 ∧ · · · ∧ Bn, where

◮ k, n ≥ 0, ◮ the B’s are atomic formulas, ◮ x1, . . . , xk are all the variables which occur in B1, . . . , Bn.

slide-70
SLIDE 70

Goal

Goals or queries of logic programs: formulas of the form ∃x1. . . . ∃xk. B1 ∧ · · · ∧ Bn, where

◮ k, n ≥ 0, ◮ the B’s are atomic formulas, ◮ x1, . . . , xk are all the variables which occur in B1, . . . , Bn.

Usually written without quantifiers and conjunction: B1, . . . , Bn

slide-71
SLIDE 71

Goal

Goals or queries of logic programs: formulas of the form ∃x1. . . . ∃xk. B1 ∧ · · · ∧ Bn, where

◮ k, n ≥ 0, ◮ the B’s are atomic formulas, ◮ x1, . . . , xk are all the variables which occur in B1, . . . , Bn.

Usually written without quantifiers and conjunction: B1, . . . , Bn The problem is to find out whether a goal is a logical consequence of the given logic program or not.

slide-72
SLIDE 72

The Problem and the Idea

Let P be a program and G be a goal. Problem: Is G a logical consequence of P?

slide-73
SLIDE 73

The Problem and the Idea

Let P be a program and G be a goal. Problem: Is G a logical consequence of P? Idea: Try to show that the set of formulas P ∪ {¬G} is inconsistent.

slide-74
SLIDE 74

The Problem and the Idea

Let P be a program and G be a goal. Problem: Is G a logical consequence of P? Idea: Try to show that the set of formulas P ∪ {¬G} is inconsistent. How? This we will learn in this course.

slide-75
SLIDE 75

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x).

slide-76
SLIDE 76

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x). ¬G is equivalent to ∀x.¬mortal(x).

slide-77
SLIDE 77

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x). ¬G is equivalent to ∀x.¬mortal(x). The set {∀x.mortal(x) ⇐ person(x), person(socrates), ∀x.¬mortal(x)} is inconsistent.

slide-78
SLIDE 78

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x). ¬G is equivalent to ∀x.¬mortal(x). The set {∀x.mortal(x) ⇐ person(x), person(socrates), ∀x.¬mortal(x)} is inconsistent. Hence, G is a logical consequence of P.

slide-79
SLIDE 79

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x). ¬G is equivalent to ∀x.¬mortal(x). The set {∀x.mortal(x) ⇐ person(x), person(socrates), ∀x.¬mortal(x)} is inconsistent. Hence, G is a logical consequence of P. We can even compute the witness term for the goal: x = socrates.

slide-80
SLIDE 80

Example

Let P consist of the two clauses:

◮ ∀x.mortal(x) ⇐ person(x). ◮ person(socrates).

Goal: G = ∃x.mortal(x). ¬G is equivalent to ∀x.¬mortal(x). The set {∀x.mortal(x) ⇐ person(x), person(socrates), ∀x.¬mortal(x)} is inconsistent. Hence, G is a logical consequence of P. We can even compute the witness term for the goal: x = socrates. How? This we will learn in this lecture.