Presentation is loading. Please wait.

Presentation is loading. Please wait.

PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion.

Similar presentations


Presentation on theme: "PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion."— Presentation transcript:

1 PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion. For example:- it is raining =P it is sunny=Q A proposition: If it is raining, then it is not sunny P  ¬Q

2 In Propositional Calculus, a single propsitional symbol P may denote the entire sentence “it rained on Tuesday” it rained on Tuesday =P In Predicate Calculus, a predicate weather may be created, that describes a relationship between a day and the weather: weather(tuesday,rain) Predicate Calculus also allows expressions to contain variables. For example: For all values of X, where X is a day of the week, the statement weather(X,rain) is true: i.e. it rains every day.

3 SYNTAX OF PREDICATES

4  Symbols are used to denote objects, properties or relations in the world of discourse.  The use of WORDS that suggest the symbol’s intended meaning assists programmers in understanding program code. Thus, l ( g,k ) = like (george, kate )  Both are formally equal in predicate calculus.  But later can be a great help, for humans, in indicating the relationship the expression represents.  Predicate Calculus, however, concerns only with the formal semantics.  Parentheses “( )”, commas “,” and periods”.” are used to form well formed expressions. These are called Improper Symbols.  Predicate symbols represent:-  Constants  Variables  Functions  Predicates

5  Constants  Used to name specific objects or properties in the world.  Constant symbols must begin with a lowercase letter.  Examples:  george  tree  tall  bLUe  aRT  true and false are constants, they are reserved as truth symbols.  Variables  Variable symbols represent general classes of objects or properties in the world.  Variable symbols must begin with an uppercase letter.  Examples:  George  Tree  Tall  BLUe  ART

6  Functions  A function expression is a function symbol followed by its argument. functionsymbol ( argument )  Function symbol begins with a lowercase letter.  A function expression consists of a function constant of arity n, followed by n terms, t1,t2,…,tn, enclosed in parentheses and separated by commas. func ( t1,t2,t3,…,tn ) goerge ( likes,kate ) george is a function constant of arity 2, and there are two terms of argument.  Examples:  f(X,Y)  father(david)  price(banana)  plus(2,3)

7 A predicate calculus term is either a constant, variable or function expression.

8 Predicate Calculus Symbols  A predicate name a relationship between none (zero) or more objects in the world.  Number of objects so related is the arity of the predicate.  Predicate symbols begin with lowercase letters.  An atomic sentence in Predicate Calculus is a predicate of arity n followed by n terms enclosed in parentheses and separated by commas.  Predicate sentences are delimited by a period (.). likes ( goerge, kate ). Predicate of arity 2 two terms enclosed in parenthesesdelimiter likes(goerge, kate, jim,tuesday ). Predicate of arity 44 terms enclosed in parentheses delimiter

9  Examples of atomic sentences:  likes(george,kate).  likes(geore,susie).  frieds(bill,goerge).  helps(bill,george).  likes,(X,george).  likes(X,X).  friends(father(david),father(andrew)).  Likes, friends, help are predicate symbols.  Predicates with the same names but different arities are considered different.  Bill, george, kate etc are constant symbols and represent objects in the problem domain.  The arguments to a predicate are terms and may also include variables or function expressions. For example:- friends(father(david),father(andrew)).

10

11  Atomic sentences are also called atomic expressions, atoms or propositions.  Atomic sentences may be combined with connectives: ¬, v, , ,   A variable in the sentence refers to unspecified objects in the domain.  Predicate calculus includes two symbols that defines the meaning of a sentence containing a variable. These are variable quantifiers:  Universal quantifier –  : indicate that sentence is true for all values of variable in the domain.  Existential quantifier --  : indicate that sentence is true for some values of variable in the domain.  A quantifier is followed by a variable and a sentence, such that:   Y friends(Y,peter).: A few elements of the domain are friends of Peter.   X likes(X,ice_cream). :All elements of the domain like ice cream.

12

13 Examples of well formed predicate sentences: Let times and plus be function symbols of arity 2 Let equal and foo be predicate symbols of arity 2 and 3 respectively. plus (2, 3) is a function. Not an atomic sentence. equal (plus (2, 3), five). Is an atomic sentence. equal (plus (2, 3), seven). Is an atomic sentence. Though the interpretation value of this sentence is false. But well formedness and truth values are independent issues.  X foo(X,two,plus(2,3))  equal(plus(2,3),five). is a sentence because both the conjuncts are sentences. (foo(two,two,plus(2,3)))  (equal(plus(2,3),five)=true). is a sentence because all its components are sentences connected by logical operators.

14 verify_sentence algorithm

15 Assignment Submit the flow diagram of the algorithm shown on previous slide

16 SEMANTICS FOR THE PREDICATE CALCULUS Predicate calculus semantics provide a formal basis for determining the truth values of expressions. The truth of expressions depends on the mapping of constants, variables, predicates, and functions into the objects and relations in the domain of discourse. For example: Information about a person George and his friends Kate and Susie may be expressed by: friends(george,susie). friends(george,kate). If it is true that George is a friend of Kate and Susie, then each expression would have truth value (assignment) “T”. If George is friend of Kate but not of Susie, then, friends(george,kate). Has the truth value ”T”. and, friends(george,susie). Has the truth value ”F”.

17 5. Given an interpretation, the meaning of an expression is a truth value assigned over the interpretation.

18 INTERPRETATION Sentence: friends(father(david),father(andrew)). Functions: father(david) function evaluation : george father(andrew) function evaluation : allen Semantics of expression: friends(george,allen).

19

20 For example:  (Likes) Likes(george,kate).For example:  (Likes) Likes(george,kate). Is not a well-formed expression in the first-order predicate calculus. Any grammatically correct English sentence may be represented in first-order predicate calculus using the symbols,connectives and variables.Any grammatically correct English sentence may be represented in first-order predicate calculus using the symbols,connectives and variables. A few examples of sentences represented in predicate calculus:A few examples of sentences represented in predicate calculus: If it doesn’t rain tomorrow, Aslam will go to the mountains.If it doesn’t rain tomorrow, Aslam will go to the mountains. ¬ weather (rain, tomorrow)  go (aslam, mountains). All basketball players are tall.All basketball players are tall.  X (basketball_player (X)  tall(X)). Some people like bananas.Some people like bananas.  X (person (X)  likes ( X, bananas)). Nobody likes taxes.Nobody likes taxes. ¬  X likes (X, taxes)

21 Model the blocks world of figure to design a control algorithm for a robot arm. Computer has knowledge of location of blocks and the robot arm. It can keep record of these locations as the robot hand moves blocks about the table. To pick up a block and stack it on another block, both blocks must be clear. If block a is required to be moved, it is not clear. The arm can change the state of the world and clear a block. The arm can move block c from block a, and update its knowledge base to reflect this by deleting the assertion on(c,a). The program needs to be able to infer that block a has become clear. The following rule describes when a block is clear:  X (¬  Y on (Y, X)  clear ( X )). Following rule describes operations to stack a block on top of another. For example to stack X on Y: 1.Empty the hand. 2.Then clear X. 3.Then clear Y. 4.Then pickup X. 5.Put down X on Y.  X  Y (( hand_empty  X  Y (( hand_empty  clear (X)  clear(Y)   stack (X,Y)). pick_up (X)  pu_down (X,Y))  stack (X,Y)). A BLOCK WORLD PROBLEM

22 Slide 2.22 INFERENCE RULES  The ability to infer new correct expressions from a set of true assertions is an important feature of predicate calculus.  These new expressions are correct in that they are consistent with all previous interpretations of the original set of expressions.  An interpretation that makes a sentence true is said to satisfy that sentence.  An interpretation that satisfy every member of a set of expressions is said to satisfy the set.  An expression X logically follows from a set of predicate calculus expressions S if every interpretation that satisfy S also satisfy X.  The function of logical inference is to produce new sentences that logically follow a set of predicate calculus sentences.  An inference rule is essentially a mechanical means of producing new predicate calculus sentences from other sentences.  X human (X)  mortal (X).human( socrates). S:  X human (X)  mortal (X).human( socrates). I: all human die. X: mortal (socrates).X, an expression logically following from S (also satisfied by I)


Download ppt "PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion."

Similar presentations


Ads by Google