Tải bản đầy đủ (.pdf) (69 trang)

Biểu diễn tri thức nhờ logic vị từ bậc một

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (654.86 KB, 69 trang )

PGS.TS. Phan Huy Kh
PGS.TS. Phan Huy Kh
á
á
nh
nh


H
H



chuyên gia
chuyên gia

(
(
Expert System
Expert System
)
)
Chng 2
Biu din tri thc

nh

logic v

t


bc mt
2.3
2/
2/
69
69
Chng
Chng
2
2

Bi
Bi


u di
u di


n tri th
n tri th


c nh
c nh



logic v
logic v




t
t



b
b


c m
c m


t
t
\
\
Ph
Ph


n 2.3 :
n 2.3 :
u
u
Lôgic v
Lôgic v



t
t


b
b


c m
c m


t
t
u
u
Bi
Bi


u di
u di


n tri th
n tri th



c nh
c nh


logic v
logic v


t
t


b
b


c m
c m


t
t
3/
3/
69
69
Limitations of Propositional Logic 2
Limitations of Propositional Logic 2
\
\

Can't directly talk about properties of individuals
Can't directly talk about properties of individuals
or relations between individuals
or relations between individuals
u
u
E.g.,
E.g.,
how to represent the fact that John is tall?
how to represent the fact that John is tall?
\
\
We have no way to conclude that
We have no way to conclude that
John is good at
John is good at
basketball
basketball
!
!
\
\
Generalizations, patterns, regularities can't easily be
Generalizations, patterns, regularities can't easily be
represented
represented
u
u
E.g.,
E.g.,

all triangles have 3 sides
all triangles have 3 sides
4/
4/
69
69
Predicate Logic Overview
Predicate Logic Overview
\
\
Predicate Logic
Predicate Logic
u
u
Principles
Principles
u
u
Objects
Objects
u
u
Relations
Relations
u
u
properties
properties
\
\

Syntax
Syntax
\
\
Semantics
Semantics
\
\
Extensions and Variations
Extensions and Variations
\
\
Proof in Predicate Logic
Proof in Predicate Logic
\
\
Important
Important
Concepts and Terms
Concepts and Terms
5/
5/
69
69
Delimiters

, ( )

Delimiters


, ( )
Constants

a z

Constants

a z
Variale

A Z

Variale

A Z
Function

f g h

Function

f g h
Predicate

P
0

P Q R

Predicate


P
0

P Q R
Connective

¬∧∨→↔

Connective

¬∧∨→↔
Quantifier

∀∃

Quantifier

∀∃
Term

t
i

Term

t
i
Term


f(t
1

, …t
n

)

Term

f(t
1

, …t
n

)
Atom

P Q R

Atom

P Q R
Atom

P(t
1

, …t

n

)

Atom

P(t
1

, …t
n

)
Wff

P∧

Q →

R

Wff

P∧

Q →

R
W
ff


∃X ∀Y (P(X, Y) →

R(Y))

Wff

∃X ∀Y (P(X, Y) →

R(Y))
Alphabet
Alphabet
6/
6/
69
69
B
B


ng ký hi
ng ký hi


u (
u (
Alphabet
Alphabet
)
)

\
\
B
B


ng ký hi
ng ký hi


u đ
u đ


xây d
xây d


ng c
ng c
á
á
c bi
c bi


u th
u th



c đ
c đ
ú
ú
ng g
ng g


m :
m :
u
u
C
C
á
á
c
c
d
d


u phân c
u phân c
á
á
ch
ch
(separator signs) :
(separator signs) :

d
d


u ph
u ph


y (
y (
,
,
), d
), d


u m
u m



ngo
ngo


c (
c (
(
(


) v
) v
à
à

d
d


u đ
u đ
ó
ó
ng ngo
ng ngo


c (
c (
)
)
)
)
u
u
C
C
á
á
c

c
h
h


ng
ng
(constant) :
(constant) :
c
c
ó
ó

d
d


ng chu
ng chu


i s
i s



d
d



ng c
ng c
á
á
c ch
c ch



c
c
á
á
i in th
i in th


ng
ng
a
a


z
z
V
V
í
í

d
d


: a, block
: a, block
u
u
C
C
á
á
c
c
bi
bi


n
n
(variable) :
(variable) :
c
c
ó
ó

d
d



ng chu
ng chu


i s
i s



d
d


ng c
ng c
á
á
c ch
c ch



c
c
á
á
i in hoa
i in hoa
A

A


Z
Z
V
V
í
í
d
d


: X, NAME.
: X, NAME.
u
u
C
C
á
á
c
c
v
v


t
t



(predicate) :
(predicate) :
đ
đ


c vi
c vi


t tng t
t tng t



c
c
á
á
c
c
bi
bi


n
n
, s
, s




d
d


ng c
ng c
á
á
c ch
c ch



c
c
á
á
i in hoa
i in hoa
A
A


Z
Z
V
V

í
í
d
d


: ISRAINING, ON(table), P(X, blue), BETWEEN(X, Y, Z)
: ISRAINING, ON(table), P(X, blue), BETWEEN(X, Y, Z)
7/
7/
69
69
B
B


ng ký hi
ng ký hi


u (
u (
Alphabet
Alphabet
)
)
\
\
C
C

á
á
c ph
c ph
é
é
p n
p n


i logic (logical connector) :
i logic (logical connector) :
u
u
¬
¬
,
,


,
,


,
,


v
v

à
à


tng
tng


ng v
ng v


i c
i c
á
á
c ph
c ph
é
é
p ph
p ph


đ
đ


nh, v
nh, v

à
à
, ho
, ho


c, k
c, k
é
é
o theo v
o theo v
à
à
k
k
é
é
o
o
theo l
theo l


n nhau (
n nhau (
tng đng
tng đng
)
)

\
\
C
C
á
á
c
c
d
d


u l
u l


ng t
ng t


u
u


l
l


ng t
ng t



t
t


n t
n t


i (existential quantifier)
i (existential quantifier)
u
u


l
l


ng t
ng t


to
to
à
à
n th
n th



(universal quantifier)
(universal quantifier)
8/
8/
69
69
Names
Names
\
\
Constants are used to name existing
Constants are used to name existing
objects:
objects:
u
u
The interpretation identifies the object in the real world
The interpretation identifies the object in the real world
u
u
No
No
constant can name more than one object
constant can name more than one object
u
u
An object can have more than one
An object can have more than one

name or
name or
no name at
no name at
all
all
\
\
Variables:
Variables:
V = {X, Y, Z,
V = {X, Y, Z,


}
}
Leonard Euler
Leonard Euler
Honest Abe
Honest Abe
Lincoln
Lincoln
Gaius
Gaius

Sempronius
Sempronius

Gracchus
Gracchus

Tiberius
Tiberius

Sempronius
Sempronius

Gracchus
Gracchus
9/
9/
69
69
BNF Grammar Predicate Logic
BNF Grammar Predicate Logic
<Sentence>
<Sentence>




<AtomicSentence
<AtomicSentence
>
>
|
|
(
(
<
<

Sentence>
Sentence>

<
<
Connective>
Connective>
<
<
Sentence>)
Sentence>)
|
|
<
<
Quantifier>
Quantifier>

<
<
Variable>,
Variable>,

<
<
Sentence>
Sentence>
|
|
¬

¬

<
<
Sentence
Sentence
>
>
<
<
AtomicSentence>
AtomicSentence>




<
<
Predicate>(<Term>,
Predicate>(<Term>,
)
)

|
|

<
<
Term>=
Term>=


<
<
Term>
Term>
<
<
Term>
Term>




<
<
Function>(<Term>
Function>(<Term>
,
,
)
)

|
|
<
<
Constant> |
Constant> |

<

<
Variable
Variable
>
>
<
<
Connective>
Connective>







|
|




|
|




|
|




<
<
Quantifier>
Quantifier>






|
|



<
<
Constant>
Constant>




a, b, c, max, carl
a, b, c, max, carl
, jim, jack
, jim, jack

<
<
Variable>
Variable>




A, B, C, X
A, B, C, X

1
1
, X
, X

2
2

, COUNTER, POSITION
, COUNTER, POSITION
<Function>
<Function>




father
father
-

-
of, square
of, square
-
-
position, sqrt, cosine
position, sqrt, cosine
<
<
Predicate>
Predicate>




P, Q,
P, Q,
LARGER, BETWEEN
LARGER, BETWEEN
, YOUNGER
, YOUNGER
-
-
THAN
THAN
Ambiguities
Ambiguities

are resolved through precedence or parentheses
are resolved through precedence or parentheses

10/
10/
69
69
First Order Predicate Logics Syntax
First Order Predicate Logics Syntax
term
term

::=
::=

variable
variable

| function_symbol_of_arity_n(t
| function_symbol_of_arity_n(t

1
1

,
,


, t
, t

n
n


)
)

n>0
n>0

| function_symbol_of_arity_0
| function_symbol_of_arity_0

constant
constant
atom
atom

::=
::=

predicate_symbol_of_arity_n(t
predicate_symbol_of_arity_n(t

1
1

,
,


, t
, t


n
n

)
)

n>0
n>0

| predicate_symbol_of_arity_0
| predicate_symbol_of_arity_0

constant
constant
literal
literal

::=
::=

atom
atom

positive literal
positive literal

|
|
¬

¬

atom
atom

negative literal
negative literal
wff
wff

::=
::=

atom
atom

well formed formula (
well formed formula (
sentence)
sentence)

| (
| (
¬
¬

wff)
wff)

negation

negation

| (wff
| (wff



wff)
wff)

conjunction
conjunction

| (wff
| (wff



wff)
wff)

disjunction
disjunction

| (wff
| (wff



wff)

wff)

implication
implication

| (wff
| (wff



wff)
wff)

equivalence
equivalence

| (
| (



variable wff)
variable wff)

universal
universal

formula
formula


| (
| (



variable wff)
variable wff)

existential
existential

formula
formula
11/
11/
69
69
C
C
á
á
c h
c h
à
à
m (function)
m (function)
\
\
C

C
á
á
c h
c h
à
à
m :
m :
u
u
c
c
ó
ó
c
c
á
á
ch vi
ch vi


t tng t
t tng t


c
c
á

á
c h
c h


ng
ng
u
u
s
s


d
d


ng c
ng c
á
á
c ch
c ch


in th
in th


ng

ng
a
a


z
z
u
u
M
M


i h
i h
à
à
m c
m c
ó
ó
b
b


c (hay s
c (hay s


l

l


ng c
ng c
á
á
c đ
c đ


i) c
i) c


đ
đ


nh, l
nh, l
à
à
m
m


t s
t s





nguyên dng
nguyên dng
\
\
V
V
í
í
d
d


:
:
u
u
f(X), weight(elephan), successor(M, N)
f(X), weight(elephan), successor(M, N)
l
l
à
à
c
c
á
á
c h

c h
à
à
m c
m c
ó
ó
b
b


c l
c l


n l
n l


t l
t l
à
à
1, 1, v
1, 1, v
à
à
2
2
\

\
Ng
Ng


i ta quy 
i ta quy 


c r
c r


ng :
ng :
u
u
C
C
á
á
c h
c h


ng l
ng l
à
à
nh

nh


ng h
ng h
à
à
m b
m b


c không (nil)
c không (nil)
u
u
V
V
í
í
d
d


: a, elephan, block l
: a, elephan, block l
à
à
c
c
á

á
c h
c h


ng
ng
12/
12/
69
69
Function Symbols
Function Symbols
\
\
Function symbols
Function symbols
u
u
function_name(arg
function_name(arg
1
1
, arg
, arg
2
2
,
,



, arg
, arg
n
n
)
)
u
u
Identifies the object referred to by a tuple of objects
Identifies the object referred to by a tuple of objects
u
u
May be defined implicitly through other functions, or explicitly
May be defined implicitly through other functions, or explicitly
through tables
through tables
\
\
Function names begin with a lowercase letter or are
Function names begin with a lowercase letter or are
expressed with a symbol
expressed with a symbol
u
u
F = {f, g, h,
F = {f, g, h,


} = F

} = F
0
0


F
F
1
1


F
F
2
2




\
\
Function arities:
Function arities:
u
u
F
F
0
0
: function symbols of arity 0 (constants):

: function symbols of arity 0 (constants):
a, b, max,
a, b, max,
jim
jim
u
u
F
F
1
1
: function symbols of arity 1 (one argument)
: function symbols of arity 1 (one argument)
u
u
F
F
2
2
: function symbols of arity 2 (two arguments)
: function symbols of arity 2 (two arguments)
u
u


13/
13/
69
69
Functions Examples

Functions Examples
\
\
A function is used to express complex names
A function is used to express complex names
u
u
age(max)
age(max)
Max
Max


s age
s age
u
u
password(claire)
password(claire)
Claire
Claire


s password
s password
\
\
A function may be nested
A function may be nested
u

u
Max
Max


s age
s age


s double
s double
double(age(max))
double(age(max))
u
u
father(mother(max))
father(mother(max))
Max
Max


s mother
s mother


s father
s father
u
u
starship(son(dr_crusher))

starship(son(dr_crusher))
Dr_Crusher
Dr_Crusher


s son
s son


s starship
s starship
\
\
A function is never a predicate
A function is never a predicate
u
u
Can
Can


t nest predicates
t nest predicates
TALL(TALL(max))
TALL(TALL(max))
\
\
Function symbols of arity >1
Function symbols of arity >1
u

u
youngestChild(max, ann)
youngestChild(max, ann)
Max and Ann
Max and Ann


s youngest child
s youngest child
u
u
*(5, +(2, 4))
*(5, +(2, 4))
30
30
\
\
A predicate forms a sentence,
A predicate forms a sentence,
while a function names an individual
while a function names an individual
14/
14/
69
69
H
H


ng, hay h

ng, hay h


ng t
ng t



(term)
(term)
\
\
H
H


ng đ
ng đ


c t
c t


o th
o th
à
à
nh t
nh t



hai lu
hai lu


t sau :
t sau :
u
u
C
C
á
á
c h
c h


ng v
ng v
à
à
c
c
á
á
c bi
c bi



n l
n l
à
à
c
c
á
á
c h
c h


ng
ng
u
u
N
N


u f l
u f l
à
à
m
m


t h
t h

à
à
m c
m c
ó
ó
b
b


c n
c n


1
1
v
v
à
à
n
n


u t
u t
1
1
, , t
, , t

n
n
đ
đ


u l
u l
à
à
c
c
á
á
c h
c h


ng,
ng,
th
th
ì
ì
h
h
à
à
m f (t
m f (t

1
1
, , t
, , t
n
n
) c
) c


ng l
ng l
à
à
m
m


t h
t h


ng
ng
\
\
V
V
í
í

d
d


c
c
á
á
c h
c h
à
à
m sau đây đ
m sau đây đ


u l
u l
à
à
c
c
á
á
c h
c h


ng :
ng :

u
u
successor(X, Y), weight(b), successor(b, wight(Z))
successor(X, Y), weight(b), successor(b, wight(Z))
\
\
Nhng c
Nhng c
á
á
c h
c h
à
à
m sau đây không ph
m sau đây không ph


i l
i l
à
à
h
h


ng :
ng :
u
u

P(X, blue) v
P(X, blue) v
ì
ì
P l
P l
à
à
v
v


t
t


u
u
weight (P(b))
weight (P(b))
v
v
ì
ì
P(b) không ph
P(b) không ph


i l
i l

à
à
h
h


ng (v
ng (v


t
t


không l
không l
à
à
m đ
m đ


i cho h
i cho h
à
à
m)
m)
15/
15/

69
69
Predicates
Predicates
\
\
Predicate
Predicate
symbols
symbols
:
:
u
u
PREDICATE(arg
PREDICATE(arg
1
1
, arg
, arg
2
2
,
,


, arg
, arg
n
n

)
)
u
u
A (determinate) property possessed by an object: Shape, Size
A (determinate) property possessed by an object: Shape, Size
u
u
A (determinate) relationship among objects:
A (determinate) relationship among objects:
Shape relationship, size relationship, positional relationship
Shape relationship, size relationship, positional relationship


u
u
The number of arguments is called the predicate
The number of arguments is called the predicate


s arity
s arity
u
u
The order of the arguments is important
The order of the arguments is important
\
\
Predicates have names beginning with an uppercase letter
Predicates have names beginning with an uppercase letter

or are represented by an operator symbol
or are represented by an operator symbol
u
u
P = P
P = P
0
0


P
P
1
1


P
P
2
2




\
\
Predicate
Predicate
arities:
arities:

P
P

0
0

: predicate symbols of arity 0 (constants: proposition) : P, Q,
: predicate symbols of arity 0 (constants: proposition) : P, Q,
R,
R,


P
P

1
1

: predicate symbols of arity 1 (one argument)
: predicate symbols of arity 1 (one argument)
P
P

2
2

: predicate symbols of arity 2 (two arguments)
: predicate symbols of arity 2 (two arguments)



16/
16/
69
69
Nguyên t
Nguyên t



(atom)
(atom)
\
\
Nguyên t
Nguyên t


đ
đ


c t
c t


o th
o th
à
à
nh t

nh t


hai lu
hai lu


t sau :
t sau :
u
u
C
C
á
á
c m
c m


nh đ
nh đ


(v
(v


t
t



b
b


c 0) l
c 0) l
à
à
c
c
á
á
c nguyên t
c nguyên t


u
u
N
N


u P l
u P l
à
à
m
m



t v
t v


t
t


b
b


c n (n
c n (n


1)
1)
v
v
à
à
n
n


u t
u t
1

1
, , t
, , t
n
n
đ
đ


u l
u l
à
à
c
c
á
á
c h
c h


ng,
ng,
th
th
ì
ì
P(t
P(t
1

1
, , t
, , t
n
n
) c
) c


ng l
ng l
à
à
m
m


t nguyên t
t nguyên t


\
\
V
V
í
í
d
d



c
c
á
á
c v
c v


t
t


sau đây l
sau đây l
à
à
c
c
á
á
c nguyên t
c nguyên t


:
:
u
u
P(X, blue), EMPTY, BETWEEN(table, X, sill(window))

P(X, blue), EMPTY, BETWEEN(table, X, sill(window))
\
\
Còn :
Còn :
u
u
successor (X, Y, sill (window)
successor (X, Y, sill (window)
không ph
không ph


i nguyên t
i nguyên t


, m
, m
à
à
l
l
à
à
c
c
á
á
c h

c h
à
à
m
m
17/
17/
69
69
Atomic Sentences
Atomic Sentences
\
\
A atomic sentence:
A atomic sentence:
u
u
Expresses a claim that is either
Expresses a claim that is either
true
true
or
or
false
false
u
u
Formed by a single predicate followed by one or more
Formed by a single predicate followed by one or more
argument

argument
s
s
\
\
Example:
Example:
u
u
Max is tall
Max is tall
TALL(max)
TALL(max)
u
u
A is larger than B
A is larger than B
LARGER(A, B)
LARGER(A, B)
u
u
B is not larger than A
B is not larger than A
¬
¬
LARGER(B, A)
LARGER(B, A)
u
u
C is smaller than D, or D is not smaller than C

C is smaller than D, or D is not smaller than C
SMALLER(C, D)
SMALLER(C, D)
,
,
¬
¬
SMALLER(D, C)
SMALLER(D, C)
u
u
A is between B and E:
A is between B and E:
BETWEEN(A, B, E)
BETWEEN(A, B, E)
18/
18/
69
69
C
C
á
á
c công th
c công th


c ch
c ch



nh
nh
\
\
C
C
á
á
c công th
c công th


c ch
c ch


nh (C
nh (C
TC)
TC)
đ
đ


c t
c t


o th

o th
à
à
nh t
nh t


ba lu
ba lu


t sau :
t sau :
u
u
C
C
á
á
c nguyên t
c nguyên t


l
l
à
à
c
c
á

á
c CTC
c CTC
u
u
N
N


u G v
u G v
à
à
H l
H l
à
à
c
c
á
á
c CTC,
c CTC,
th
th
ì
ì
(
(
¬

¬
G), (G
G), (G


H), (G
H), (G


H), (G
H), (G


H) v
H) v
à
à
(G
(G


H)
H)
c
c


ng l
ng l
à

à
c
c
á
á
c CTC đ
c CTC đ


c t
c t


o th
o th
à
à
nh t
nh t


G v
G v
à
à
H
H
u
u
N

N


u G l
u G l
à
à
m
m


t CTC v
t CTC v
à
à
X l
X l
à
à
m
m


t bi
t bi


n,
n,
th

th
ì
ì
(
(


X)G v
X)G v
à
à
(
(


X)G c
X)G c


ng l
ng l
à
à
c
c
á
á
c CTC
c CTC
\

\
(
(


X)G
X)G
đ
đ


c đ
c đ


c l
c l
à
à
:
:
u
u
T
T


n t
n t



i bi
i bi


n X sao cho G đ
n X sao cho G đ


c tho
c tho


mãn
mãn
\
\
(
(


X)G
X)G
đ
đ


c đ
c đ



c l
c l
à
à
:
:
u
u
V
V


i m
i m


i bi
i bi


n X th
n X th
ì
ì
G đ
G đ


u đ

u đ


c tho
c tho


mãn
mãn
19/
19/
69
69
B
B
à
à
i t
i t


p
p



l
l



p : Chuy
p : Chuy


n th
n th
à
à
nh v
nh v



t
t


\
\
Ai đ
Ai đ


18 tu
18 tu


i m
i m



i đ
i đ


c ph
c ph
é
é
p l
p l
á
á
i xe
i xe
\
\
G
G
á
á
i đ
i đ


18 tu
18 tu


i, trai 20 tu

i, trai 20 tu


i m
i m


i đ
i đ


c ph
c ph
é
é
p l
p l


p gia đ
p gia đ
ì
ì
nh
nh
\
\
Ki
Ki



m tra h
m tra h


s
s
u
u
Nh
Nh


p h
p h


c t
c t


i c
i c
á
á
c tr
c tr


ng H

ng H
,
,
C
C
u
u
S
S


n ph
n ph


m
m
u
u
Quy tr
Quy tr
ì
ì
nh công ngh
nh công ngh




Mn reng tui ly ví


d

?
1.

Xác đnh không gian các s

kin,
nhân vt tht liên quan
2.

Tìm các hng, bin, hàm và/hoc v

t
tng ng vi các phát biu
3.

Gán ngha cho tng thành phn đ

kim tra tính đúng đn
4.

Nhn kt qu
20/
20/
69
69
Well
Well

-
-
formed Formula (
formed Formula (
wff
wff
)
)
\
\
Any atomic sentence is a
Any atomic sentence is a
wff
wff
\
\
If A are B are
If A are B are
wffs
wffs
then so are
then so are
¬
¬
A
A
A
A




B
B
A
A



B
B
A
A



B
B
A
A



B
B
\
\
B is a cube or B is large (a large cube):
B is a cube or B is large (a large cube):
CUBE(B)
CUBE(B)




LARGE(B)
LARGE(B)
\
\
E and C are in the same row and E is in back of B:
E and C are in the same row and E is in back of B:
SAMEROW(E, C)
SAMEROW(E, C)



BACKOF(E, B)
BACKOF(E, B)
21/
21/
69
69
Equality
Equality
\
\
Equality indicates that two terms refer to the same object
Equality indicates that two terms refer to the same object
=(A, B)
=(A, B)
u
u

A and B are identical
A and B are identical
u
u
Usually, written in infix form A = B
Usually, written in infix form A = B
u
u
The equality symbol
The equality symbol


=
=


is an (in
is an (in
-
-
fix) shorthand
fix) shorthand
u
u
FATHER(jane) = jim,
FATHER(jane) = jim,
or
or
=(FATHER(jane), jim)
=(FATHER(jane), jim)

u
u
E.g. Jim is Jane
E.g. Jim is Jane


s and John
s and John


s father
s father
\
\
Equality by reference and equality by value
Equality by reference and equality by value
u
u
Sometimes the distinction between referring to the same object
Sometimes the distinction between referring to the same object
and referring to two objects that are identical (indistinguishab
and referring to two objects that are identical (indistinguishab
le)
le)
can be important
can be important
\
\
E
E



E
E
E is not identical to iteself
E is not identical to iteself
22/
22/
69
69
V
V
í
í

d
d


\
\
C
C
á
á
c công th
c công th


c sau đây l

c sau đây l
à
à
ch
ch


nh :
nh :
u
u
(
(


X) (
X) (


Y) ((P(X, Y)
Y) ((P(X, Y)


Q(X, Y)
Q(X, Y)


R(X))
R(X))
u

u
((
((
¬
¬
(P(a)
(P(a)


P(b)))
P(b)))


¬
¬
P(b))
P(b))
\
\
Còn c
Còn c
á
á
c công th
c công th


c sau đây không ch
c sau đây không ch



nh :
nh :
u
u
(
(
¬
¬
(f(a))
(f(a))
: ph
: ph


đ
đ


nh c
nh c


a m
a m


t h
t h
à

à
m,
m,
u
u
f (P(a))
f (P(a))
: h
: h
à
à
m c
m c
ó
ó
đ
đ


i l
i l
à
à
m
m


t v
t v



t
t


\
\
Ch
Ch
ú
ú
ý :
ý :
u
u
CTC đ
CTC đ


c g
c g


i l
i l
à
à
m
m



t tr
t tr


c ki
c ki


n (literal) hay tr
n (literal) hay tr


đ
đ
ú
ú
ng n
ng n


u n
u n
ó
ó
l
l
à
à
m

m


t nguyên t
t nguyên t


hay c
hay c
ó
ó
d
d


ng (
ng (
¬
¬
G), v
G), v


i G l
i G l
à
à
m
m



t nguyên t
t nguyên t


u
u
Trong m
Trong m


t CTC,
t CTC,
tr
tr


c ho
c ho


c sau c
c sau c
á
á
c ký t
c ký t


n

n


i, ký t
i, ký t


phân
phân
c
c
á
á
ch, c
ch, c
á
á
c h
c h


ng, c
ng, c
á
á
c bi
c bi


n, c

n, c
á
á
c h
c h
à
à
m, c
m, c
á
á
c v
c v


t
t


, n
, n
g
g


i ta c
i ta c
ó
ó
th

th




đ
đ


t t
t t
ù
ù
y ý c
y ý c
á
á
c d
c d


u c
u c
á
á
ch (space hay blank)
ch (space hay blank)
23/
23/
69

69
C
C
á
á
c b
c b


c xây d
c xây d


ng CTC
ng CTC
\
\
Cho m
Cho m


t ph
t ph
á
á
t bi
t bi


u (s

u (s


ki
ki


n) trong NNTN :
n) trong NNTN :
u
u
(C
(C
h ai
h ai
)
)
đi mô c
đi mô c


ng nh
ng nh


v
v


H

H
à
à
T
T


nh
nh
\
\
X
X
á
á
c đ
c đ


nh c
nh c
á
á
c mi
c mi


n đ
n đ



i t
i t


ng :
ng :
u
u
Ng
Ng


i : cu Tý, cu T
i : cu Tý, cu T
è
è
o, c
o, c
á
á
i N
i N


X
X


D1

D1
u
u
Quê : H
Quê : H
à
à
T
T


nh, H
nh, H
à
à
Tây, H
Tây, H
à
à
Giang
Giang


Y
Y


D2
D2
\

\
X
X
á
á
c đ
c đ


nh c
nh c
á
á
c quan h
c quan h


đ
đ


xây d
xây d


ng c
ng c
á
á
c m

c m


nh đ
nh đ


u
u
Cu Tý quê H
Cu Tý quê H
à
à
T
T


nh : QUÊ(cutý, h
nh : QUÊ(cutý, h
à
à
t
t


nh), QUÊ(X, Y)
nh), QUÊ(X, Y)
u
u
Cu Tý xa quê H

Cu Tý xa quê H
à
à
T
T


nh : XAQUÊ(cutý, h
nh : XAQUÊ(cutý, h
à
à
t
t


nh), XAQUÊ(X, Y)
nh), XAQUÊ(X, Y)
u
u
Cu Tý nh
Cu Tý nh


quê H
quê H
à
à
T
T



nh :
nh :
NH
NH


QUÊ(cutý, h
QUÊ(cutý, h
à
à
t
t


nh), NH
nh), NH


QUÊ(X, Y)
QUÊ(X, Y)
\
\
Xây d
Xây d


ng CTC
ng CTC
u

u


X
X
,
,


Y (
Y (
QUÊ(X, Y)
QUÊ(X, Y)


XAQUÊ(X, Y)
XAQUÊ(X, Y)


NH
NH


QUÊ(X, Y)
QUÊ(X, Y)
)
)
24/
24/
69

69
Predicate Logics: some terminology
Predicate Logics: some terminology
\
\
There is a predicate logic for each basis
There is a predicate logic for each basis
B=
B=
(
(
F, P
F, P
)
)
of function and predicate symbols
of function and predicate symbols
\
\
Terms formed on basis B are called
Terms formed on basis B are called
B
B
-
-
terms
terms
:
:
the set of all B

the set of all B
-
-
terms is denoted
terms is denoted
T
T
B
B
\
\
Formulas formed on basis B are called
Formulas formed on basis B are called
B
B
-
-
formulas
formulas
:
:
the set of all B
the set of all B
-
-
formulas is denoted
formulas is denoted
WFF
WFF
B

B
\
\
Formulas with all variables bound to a quantifier
Formulas with all variables bound to a quantifier
are called
are called
closed formulas
closed formulas
\
\
Formulas with no quantifier
Formulas with no quantifier
are called
are called
quantifier free formulas
quantifier free formulas
\
\
Formulas with no quantifier and no variable
Formulas with no quantifier and no variable
are called
are called
ground formulas
ground formulas
25/
25/
69
69
M

M


t s
t s



nh
nh


n x
n x
é
é
t 1
t 1
\
\
T
T


nay ta quy 
nay ta quy 


c r
c r



ng, trong m
ng, trong m


t CTC :
t CTC :
u
u
M
M


t bi
t bi


n đ
n đ


c l
c l


ng t
ng t



h
h
ó
ó
a s
a s


xu
xu


t hi
t hi


n ngay sau
n ngay sau


hay
hay


u
u
Ph
Ph



m vi l
m vi l


ng t
ng t


h
h
ó
ó
a c
a c


a bi
a bi


n k
n k


t
t


v
v



tr
tr
í
í
xu
xu


t hi
t hi


n tr
n tr


đi
đi
u
u
C
C
ó
ó
th
th



c
c
ó
ó
c
c
á
á
c bi
c bi


n t
n t


do (free variable),
do (free variable),
l
l
à
à
c
c
á
á
c bi
c bi



n không đ
n không đ


c l
c l


ng t
ng t


h
h
ó
ó
a
a
u
u
V
V
í
í
d
d


: P(X) v
: P(X) v

à
à
(
(


Y) Q(X, Y) c
Y) Q(X, Y) c
ó
ó
ch
ch


a bi
a bi


n t
n t


do X
do X
\
\
Logic v
Logic v



t
t


đ
đ


c g
c g


i l
i l
à
à
«
«
b
b


c m
c m


t
t
»
»

(first
(first


order) :
order) :
u
u
Trong CTC không đ
Trong CTC không đ


nh ngh
nh ngh


a l
a l


ng t
ng t


cho v
cho v


t
t



hay cho h
hay cho h
à
à
m
m
u
u
V
V
í
í
d
d


: (
: (


P)P(a) v
P)P(a) v
à
à
(
(



f) (
f) (


f) (
f) (


X) P(f (X), b)
X) P(f (X), b)
không ph
không ph


i l
i l
à
à
nh
nh


ng v
ng v


t
t



b
b


c m
c m


t,
t,
m
m
à
à
c
c
ó
ó
b
b


c cao hn
c cao hn
(higher
(higher
-
-
order)
order)

×