artificial intelligence [intelligent agents paradigm]

34
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information Technology Institute of Applied Computer Systems Department of Systems Theory and Design E-mail: [email protected] SYNTAX OF PREDICATE CALCULUS

Upload: geraldine-green

Post on 03-Jan-2016

39 views

Category:

Documents


0 download

DESCRIPTION

SYNTAX OF PREDICATE CALCULUS. ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]. Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information Technology Institute of Applied Computer Systems Department of Systems Theory and Design - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

ARTIFICIAL INTELLIGENCE[INTELLIGENT AGENTS PARADIGM]

Professor Janis Grundspenkis

Riga Technical University

Faculty of Computer Science and Information Technology

Institute of Applied Computer Systems

Department of Systems Theory and Design

E-mail: [email protected]

SYNTAX OF PREDICATE CALCULUS

Page 2: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

• Predicate calculus provides more flexibility and a finer representation of the knowledge.

For example, A = ball’s color is yellow - propositional calculus representation

Color(ball, yellow) – predicate calculus representation

Page 3: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Weather(Tuesday, rain)

Weather(X, rain), where X is a day of a week

This representation enhances knowledge processing by allowing the use of variables and functions.

predicate calculus representation

B = It rained on Tuesday - propositional calculus representation

Page 4: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

SymbolsPredicate calculus symbols are irreducible syntactic

elements: they cannot be broken into their component parts by the operations.

The alphabet that makes up the symbols consists of:

1. The set of letters, both upper- and lowercase

2. The set of digits, 0, 1, ..., 9

3. The underscore, _

Page 5: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Symbols begin with the letter and are

followed by any sequence of these legal symbols.

For example, Agent007, father of, XXXXX, tom_and_jerry.

All these strings are legal symbols.

Page 6: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Contrary,

007agent, [email protected], ab%cd, #duck,are examples of strings that are not legal symbols.Improper symbols “( )”, “,”, “.”do not denote objects or relations in the world, but

are used solely to construct well-formed expressions.

Page 7: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Symbols may represent

• constants are used to name specific objects or properties.

In general, constants are symbols that begin with a lowercase letter.

Page 8: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)For example, the constant tom may

represent the object Tom, a person in the domain.

The constants true and false are reserved as truth symbols.

Page 9: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)• PredicatesA fact or proposition is divided into two parts:

a predicateand an argumentThe argument represents the object or objects of

the proposition and the predicate an assertion about the object.

Page 10: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)For example, to represent the proposition

“Tom owns a car” we would write:

owns(tom, car)

Predicate denotes some relationship between arguments

Arguments are symbols denoting objectswithin the problem

Page 11: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)• VariablesVariables are used to represent general classes of

objects or properties in the world.For example, to capture the propositions “Tom

likes Ann” and “Bob likes Mary”, we can writelikes(X, Y)

Page 12: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)In this case, variables assume or

instantiate the valuesX = {tom, bob}; Y = {ann, mary}.

Variables can be used as arguments in a predicate expression or a function

Page 13: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)• FunctionsFunction denotes a mapping of one or

more elements in a set (called the domain of the function) to a unique element of another set (the range of the function).

Page 14: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Elements of the domain and range are

objects in the world of discourse.Every function symbol has an associated

arity, indicating the number of elements in the domain mapped onto each element of the range.

Page 15: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)A function expression consists of a

function constant of arity n, followed by n terms (arguments), t1, t2, ..., tn, enclosed in parentheses and separated by commas.

Page 16: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)A term is either a constant, variable, or

function expression.

Examples: price(apples), father(tom); father(bill), left_foot_of_(tom), minus(7, 3), f(X, Y, Z)

Page 17: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Each function expression denotes the

mapping of arguments onto a single object in the range, called the value of the function.

The act of replacing a function with its value is called evaluation.

Page 18: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Symbols (continued)Example: father(tom) = bob; father(bill) =

johnFunction can be used within predicates:

colleagues(father(tom), father(bill))After the function expressions are evaluated,

the expresion becomes:colleagues(bob, john)

Page 19: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Atomic SentencesPredicates have an associated positive integer

referred to as the arity or “argument number” for the predicate.

Predicates with the same name but different arities are considered distinct.

An atomic sentence is a predicate constant of arity n, followed by n terms, t1, t2, ..., tn, enclosed in parentheses and separated by commas.

Page 20: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Atomic Sentences (continued)The truth values, true and false, are also atomic

sentences.Atomic sentences are also called atomic expressions,

atoms, or propositions.Examples: equal(minus(7, 3), seven) is an atomic

sentenceequal(minus(seven, three), four) is an atomic

sentenceminus(seven, three) is not an atomic sentence.

Page 21: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex SentencesAtomic sentences can be combined using

logical operators to form complex sentences:

Every atomic sentence is a sentence S.1. If S is a sentence, then so is S.2. If S1 and S2 are sentences, then so is S1

S2.

Page 22: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)3. If S1 and S2 are sentences, then so is

S1 S2.4. If S1 and S2 are sentences, then so is

S1 S2.5. If S1 and S2 are sentences, then so is

S1 S2.

Page 23: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)Example: likes(bob, mary)

likes(george, mary)atomic sentences

likes(bob, mary) likes(george, mary) likes(bob, george)

Page 24: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)Or, general implicationlikes(X, Y) likes(Z, Y) likes(X, Z)

Captures the knowledge“If two different individuals like the same person, then they dislike each other”

Page 25: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)When a variable appears as an argument

in a sentence, it refers to unspecified objects in the domain.

Page 26: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)Predicate calculus includes two other symbols

called variable quantifiers and , that are used to define the range or scope of the variable in a logical expression. In other words, variable quantifiers constrain the meaning of a sentence containing a variable.

Page 27: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)The universal quantifier, , indicates that the

sentence is true for all values of the quantified variable.

For example, statement “Everybody likes Mary” may be written like

X likes(X, mary)and it is true for all values of X.

Page 28: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)If X = { john, paul, george, ringo }, then

likes(john, mary) likes(paul, mary) likes(george, mary) likes(ringo, mary)

In general, X p(X) p(x1) p(x2) ... p(xn)

any predicate

Page 29: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)The existential quantifier, , indicates that sentence is

true for some value(s) in the domain, i.e., at least one value “exists” that makes the sentence true.

For example, the statement “At least someone likes ice cream” may be written like

X likes(X, ice_cream)and it is true for at least one (but not necessarily exactly one!) object, indicated by the variable X.

Page 30: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate CalculusComplex Sentences (continued)If Y = { john, paul, george, ringo }, and we know that the

first two like ice cream and the second two not, then variable X instantiate all these constants, and two statements, namely

likes(john, ice_cream) and likes(paul, ice_cream)are true, while

likes(george, ice_cream) and likes(ringo, ice_cream)are false.

If general, X p(X) p(x1) p(x2) ... p(xn)

any predicate

Page 31: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)6. If X is a variable and s a sentence, then

Xs is a sentence.7. If X is a variable and s a sentence, then

Xs is a sentence.Parentheses are used to indicate the scope of

quantification, that is, the range over which the instances of the variable hold.

Page 32: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)Examples: a) X (cat(X) animal(X))

This logical expression represents the statement “All cats are animals”.b) X (likes(X, mary) nice(mary) nice(X))This logical expression determines all instances of X who like Mary, and if Mary is nice, then it is implied that those who like Mary are also nice.

Page 33: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)c) X, Y (parent(X, Y) child(Y, X)

This logical expression represents the statement “For all persons, if X is a parent of Y, then Y is a child of X”.

d) X Y loves(X, Y)This logical expression represents the statement “Everybody loves somebody”.

Page 34: ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

Syntax of Predicate Calculus

Complex Sentences (continued)e) Y X loves(X, Y)

This logical expression represents the statement “Somebody is loved by everybody”.