Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07

Similar presentations


Presentation on theme: "CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07"— Presentation transcript:

1 CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07 Email lee@hud.ac.uklee@hud.ac.uk http://scom.hud.ac.uk/scomtlm/cia2326/

2 School of Computing and Mathematics, University of Huddersfield Propositional logic..usually means a language where propositional variables denote true and false. The language is made up of these variables and “logical connectives”. If X and Y are propositional variables then… ~X means "not X" X v Y " means "X or Y" X & Y " means "X and Y" X -> Y " means "X implies Y" or "X only if Y" X <- Y " means "X if Y" X Y " means "X if and only if Y"

3 School of Computing and Mathematics, University of Huddersfield First - order (predicate) logic FOL (FOPL) is MORE EXPRESSIVE than propositional logic. It is a notation used widely in computing for n giving meaning to systems eg relational calculus in data bases n model of computation (with computational forms such as Prolog) - to help prove program correctness - To formalise requirements in EG safety-critical systems n expressing and manipulating knowledge

4 School of Computing and Mathematics, University of Huddersfield FOPL – grammar Syntax Classes Example Syntax constants.. a,b,c... functions.. f,g,h... - apply to constants/vars predicates.. p,q,r...- unary, binary,.. variables.. x,y,z... quantifiers.. A, E (A is upside down, and E back to front) connectives.. V, &, =>,, <= Other bits.. Brackets Wffs – well formed formulae Eg Ax(p(x) => Ey q(x,y)&p(y))

5 School of Computing and Mathematics, University of Huddersfield FOPL – grammar WFF ::= ATOM | ~ ATOM | (WFF) | WFF connective WFF | quantifier variable WFF ATOM ::= predicate | predicate(ARG-LIST) ARG-LIST ::= TERM | TERM, ARG-LIST TERM ::= constant | variable | function(ARG-LIST)

6 School of Computing and Mathematics, University of Huddersfield Giving Meaning to FOPL n constants denote object names and data-type values in the world n unary predicates represent properties/classes eg cat(x), person(x),.. n other predicates represent relations between objects, and values of attributes eg brother(bill,ben), status(tank, full), between(X,Y,Z) n Wffs represent logical structure

7 School of Computing and Mathematics, University of Huddersfield Relation of FOPL with Prolog Conversion of Prolog into FOPL: Prolog clauses can be directly translated into FOPL, except for the so-called "extra logical" and "meta-logical" built in predicates. The three simple rules for conversion are: - 1. "," corresponds to "&" – 2. ":-" corresponds to "<-" 3. All variables are universally quantified. Examples grandfather(X,Y) :- father(X,Z),parent(Z,Y). In FOPC: Ax,Ax,Az (grandfather(x,y) <- (father(x,z)&parent(z,y))) uncle(X,Y) :- parent(Z,Y),brother(X,Z). In FOPC: Ax,Ay,Az ( uncle(x,y) <- (parent(z,y)&brother(x,z)))

8 School of Computing and Mathematics, University of Huddersfield FOPL: interpretation Given Wffs in FOPL, an interpretation I is given by mapping the constants, function and predicate symbols to elements in the conceptualisation Eg consider the set of wffs a., b. and c. a. Ax (P(x) -> R(x)) b. P(a) c. not (Ex P(x) & Q(x)) We may give this set many interpretations, for example: 1. Universe = people; P = "is a man", Q = "is a woman", R = "is mortal", a = "Socates". We say that Wff W is true in an interpretation I if W evaluates to true under I. The evaluation uses the “well known” meaning of connectives and quantifiers

9 School of Computing and Mathematics, University of Huddersfield FOPL: interpretation – another example Universe = persons Wffs Ax,Ax,Az g(x,y) <= (f(x,z)&p(z,y)) Ax,Ay,Az u(x,y) <= (p(z,y)&b(x,z)) Ax m(x) => p(x) Ax f(x) => p(x) Example Interpretation is: g = grandfather, f = father, p = parent, b = brother, u = uncle, m = mother Are the wffs true?

10 School of Computing and Mathematics, University of Huddersfield FOPL – reasoning IN fopl we are fundamentally interested in if a wff w LOGICALLY FOLLOWS from another wff W (usually written as “..a set of WFFs”) W |= w Definition: w logically follows from W if and only if every interpretation that makes W true also makes w true

11 School of Computing and Mathematics, University of Huddersfield FOPL – more definitions A Wff is Satisfiable – at least one interpretation makes it true Unsatisfiable – no interpretation makes it true Tautological or Valid – all interpretations makes it true

12 School of Computing and Mathematics, University of Huddersfield Conclusion: n FOPL is more expressive that Propositional Logic n We have introduced some definitions (which apply to FOPL and Propositional Logic) eg “Interpretation”, “Logically Follows”, “(Un)satisfiable” n See first 3 sections of http://scom.hud.ac.uk/scomtlm/cam326/logic/logic.html


Download ppt "CIA2326 Week4: Predicate Logic : introduction Lee McCluskey, room 2/07"

Similar presentations


Ads by Google