Presentation is loading. Please wait.

Presentation is loading. Please wait.

Predicate Logic: Syntax.

Similar presentations


Presentation on theme: "Predicate Logic: Syntax."— Presentation transcript:

1 Predicate Logic: Syntax

2 Motivations Propositional logic can only express whole sentences. It doesn’t allow you to access the components within a sentence, e.g., subject, object, adjectives, etc. Predicate logic has that capability.

3 Objectives Syllogism Predicates Universal quantifiers Existential quantifiers Define legal predicate sentences recursively

4 Many names Predicate logic Predicate calculus First-order logic First-order predicate calculus Logic of quantifiers

5 All humans are mortal Syllogism in Aristotle's Prior Analytics,
Major premise: All humans are mortal. Minor premise: Socrates is human. Conclusion: Socrates is mortal. Propositional Logic P: All humans are mortal. Q: Socrates is human. R: Socrates is mortal. But R cannot be deduced from P and Q. First Order Logic SWI-Prolog mortal(X) :- man(X). man(socrates). ?- mortal(socrates). Yes The for-all symbol is need to qualify the variable x to indicate that the IF-conditional is true not just for some x. Prolog uses the variable X and the ONLY-IF-conditional to show that the clause is true for all X.

6 Subject and predicate Access the subject of a sentence: Tony likes BBQ ribs. Lynda likes BBQ ribs. We need a special function called a predicate, e.g, like_ribs() like_ribs(tony) like_ribs(lynda) The predicate like_ribs/1 predicates (depends) on one argument which is the subject of a sentence.

7 Examples Given a world of discourse, or a domain D = {tony, lynda, samuel, daniel, ezekiel, jonathan, joy} D contains 7 constant symbols or atoms. We can say that the whole family in the House of Chan like BBQ ribs: X like_ribs (X), X in D. X is a variable, not a constant. Compare with the proposition “Everyone in the House of Chan likes BBQ ribs.” Some computers have mouse connected on the USB port.  Y computer (Y)  USB_conn (Y, mouse_of(Y))

8 Predicate logic Subject / Predicate John / went to the store. The sky / is blue. Propositional logic uses propositions Predicate logic uses predicates predicates must be applied to a subject in order to be true or false In general, a logical predicate can be applied to the objects, adjectives, or any other component of a sentence. P(X) means this predicate represented by P applied to the entity (item) represented by X

9 Family relationships mother(eve,abel). mother(eve,cain).
father(adam,abel). father(adam,cain). XY father(X,Y)  mother(X,Y)  parent(X,Y). XYZ parent(X,Y)  parent(X,Z)  sibling(Y,Z). sibling(cain,abel)?

10 Connection between the quantifiers
Change of variable X to Y. X q(X)  Y q(Y) X p(X)  Y p(Y) It is false that for all X, such that p(X) is true. E.g.: Not every student has a textbook. Or: There is at least one student who does not have the textbook.  X p(X)  X p(X) Not even one student has the textbook.  X p(X)  X p(X)

11 Types of symbols 1. Truth symbols true and false These are reserved symbols. 2. Constant symbols are symbols having the first character lowercase. E.g., today, fisher 3. Variable symbols are symbols beginning with an uppercase character or underscore. E.g., X, Y, Z, Building, _building 4. Function symbols are symbols having the first character lowercase. Arity: /number of arguments E.g., mother_of/1; maximum/2

12 Mutually recursive definitions
A function expression consists of a function symbol of arity n, followed by n terms, t1 ,t2 ,…, tn, enclosed in parentheses and separated by commas. mother_of(sam) maximum(5,38) maximum(maximum(7, 18), add_one(18)) Non-example: maximum(7, 18)  add_one(18) A FOL term is either a constant, variable, or function expression. sam Sam house_of(X) color_of(house_of(neighbor(joe)))

13 Atomic sentences Predicate symbols are symbols beginning with a lowercase letter. Predicates are special functions with true/false as the range. Arity: number of arguments An atomic sentence is a predicate constant of arity n, followed by n terms, t1 ,t2 ,…, tn, enclosed in parentheses and separated by commas. The truth values, true and false, are also atomic sentences. Atomic sentences do not contain logical connectives symbols.

14 3 examples of atomic sentences
greater_than(2, 3) mother_of(joe, susan) mother_of(sister_of(joe), susan) term, constant Predicate symbol

15 Predicate logic sentences
Every atomic sentence is a sentence. If s is a sentence, then so is its negation, s. If s1 and s2 are sentences, then so is their Conjunction, s1  s2 . Disjunction, s1  s2 . Implication, s1  s2 . Equivalence, s1  s2 .

16 Predicate logic sentences (cont’d)
If X is a variable and s is a sentence, then so are X s. X s. Remember that logical sentences evaluate to true or false, therefore only such objects are atomic sentences. Functions are not atomic sentences.

17 Checking a sentence in predicate logic
1. 2. Misprinted on p. 55 of text book 3. 4. 5.

18 Summary Unlike natural languages such as English, the semantics of predicate logic sentences are precise and unambiguous. Predicate logic is more expressive than propositional logic. It extends propositional logic by allowing functions, universal, and existential quantifiers in its sentences.


Download ppt "Predicate Logic: Syntax."

Similar presentations


Ads by Google