1 / 34

ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

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

Télécharger la présentation

ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 E-mail: Janis.Grundspenkis@rtu.lv

  2. 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

  3. predicate calculus representation Syntax of Predicate Calculus Weather(Tuesday, rain) Weather(X, rain), where X is a day of a week B = It rained on Tuesday - propositional calculus representation This representation enhances knowledge processing by allowing the use of variables and functions.

  4. Syntax of Predicate Calculus Symbols Predicate 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: • The set of letters, both upper- and lowercase • The set of digits, 0, 1, ..., 9 • The underscore, _

  5. Syntax of Predicate Calculus Symbols (continued) Symbols begin with the letter and are followed by any sequence of these legal symbols. For example, Agent007, fatherof, XXXXX, tom_and_jerry. All these strings are legal symbols.

  6. Syntax of Predicate Calculus Symbols (continued) Contrary, 007agent, tom@cs.lv, 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.

  7. 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.

  8. 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.

  9. Syntax of Predicate Calculus Symbols (continued) • Predicates A fact or proposition is divided into two parts: a predicate and an argument The argument represents the object or objects of the proposition and the predicate an assertion about the object.

  10. Arguments are symbols denoting objects within the problem Predicate denotes some relationship between arguments Syntax of Predicate Calculus Symbols (continued) For example, to represent the proposition “Tom owns a car” we would write: owns(tom, car)

  11. Syntax of Predicate Calculus Symbols (continued) • Variables Variables 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 write likes(X, Y)

  12. 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

  13. Syntax of Predicate Calculus Symbols (continued) • Functions Function 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).

  14. 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.

  15. Syntax of Predicate Calculus Symbols (continued) A function expression consists of a function constant of arity n, followed by nterms (arguments), t1, t2, ..., tn, enclosed in parentheses and separated by commas.

  16. 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)

  17. 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.

  18. Syntax of Predicate Calculus Symbols (continued) Example: father(tom) = bob; father(bill) = john Function can be used within predicates: colleagues(father(tom), father(bill)) After the function expressions are evaluated, the expresion becomes: colleagues(bob, john)

  19. Syntax of Predicate Calculus Atomic Sentences Predicates 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.

  20. 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 sentence equal(minus(seven, three), four) is an atomic sentence minus(seven, three) is not an atomic sentence.

  21. Syntax of Predicate Calculus Complex Sentences Atomic sentences can be combined using logical operators to form complex sentences: Every atomic sentence is a sentence S. • If S is a sentence, then so is S. • If S1 and S2 are sentences, then so is S1  S2.

  22. Syntax of Predicate Calculus Complex Sentences (continued) • If S1 and S2 are sentences, then so is S1  S2. • If S1 and S2 are sentences, then so is S1  S2. • If S1 and S2 are sentences, then so is S1  S2.

  23. atomic sentences Syntax of Predicate Calculus Complex Sentences (continued) Example: likes(bob, mary) likes(george, mary) likes(bob, mary)  likes(george, mary)  likes(bob, george)

  24. Syntax of Predicate Calculus Complex Sentences (continued) Or, general implication likes(X, Y)  likes(Z, Y)  likes(X, Z) Captures the knowledge“If two different individuals like the same person, then they dislike each other”

  25. 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.

  26. 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.

  27. 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.

  28. any predicate 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)

  29. 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.

  30. any predicate Syntax of Predicate Calculus Complex 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)

  31. Syntax of Predicate Calculus Complex Sentences (continued) • If X is a variable and s a sentence, then Xs is a sentence. • 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.

  32. 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.

  33. 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”.

  34. Syntax of Predicate Calculus Complex Sentences (continued) e) Y X loves(X, Y) This logical expression represents the statement “Somebody is loved by everybody”.

More Related