Vous êtes sur la page 1sur 16

UNIT - 4

FIRST ORDER LOGIC

- Propositional logic is a representational language that can achieve the illustration of logic and Knowledge base. -But Propositional language is too weak a language to represent the knowledge of complex environment in a concise way.

-So we move for first-order logic, which is sufficiently expressive to represent a good deal of knowledge.

REPRESENTATION REVISITED
-Here we examine the nature of representational languages. - Programming languages (such as C++ or Java or Lisp) are considered as the largest class of formal languages in common use. -Data structures within programs can represent facts Ex: a program could use a 4 x 4 array to represent the contents of the wumpus world. Drawback in Programming languages: - They lack the general mechanism of deriving facts from other facts. ie.., each update to a data structure is done based on the programmers knowledge of domain. - A second drawback of data structures in programs is the lack of any easy way to express the knowledge base.

- Propositional logic is a declarative language because its semantics is based on a truth relation between sentences and possible worlds. - It also has sufficient expressive power to deal with partial information, using disjunction and negation. -Propositional logic has a property that is desirable in representation languages, Called as compositionality. -Compositionality: The meaning of a sentence is a function of the meaning of its parts.

Ex:

is related to the meanings of

and

- But the Propositional logic lacks the expressive power of describing the environment with many objects concisely. Ex: Breezes and pits in each square.

In English: Squares adjacent to the pits are Breezy. ie.., the syntax and semantics of natural language is easy.

- So by combining the Natural language and Propositional logic the First order logic is developed . -In Syntax in natural language consists of: Objects, Relations and functions. Ex:

- First order logic syntax and semantics depends on the objects and relations .

- The Primary Difference between the propositional logic and first order logic is Dependent on Ontological commitment and Epistemological commitment

SYNTAX AND SEMANTICS OF FIRST ORDER LOGIC


MODEL FOR FIRST ORDER LOGIC: -The domain of a model is the set of objects it contains; these objects are sometimes called domain elements. -

- The figure shows a model with Five objects: Richard the Lionheart, King of England from 1189 1:o 1199; his younger brother, the evil King John, who ruled from 1199 to 1215; the left legs of Richard and John; and a crown. -The objects in the model may be related in various ways. A relation is just the set of tuples of objects that are related. (A tuple is a collection of objects arranged in ,a fixed order and is written with angle brackets surrounding the objects.) - Binary Relation: Thus, the brotherhood relation in this model is the set { < Richard the Lionheart, King John>,<King John , The Lionheart>} -The crown is on King John's head, so the "on head relation contains just one tuple, <the crown, King John>.

The model also contains unary relations, or properties:


-the "person" property is true for both Richard and John; - the "king" property is true only of John; - the "crown" property is true only of the crown; - Certain kinds of relationships are best considered as functions, in that a given object must be related to exactly one object in this way. Ex: model has a unary "left leg" function. <Richard the Lionheart> Richard's left leg <King John) John's left leg .

SYMBOLS AND INTERPRETATIONS SYNTAX:


- The basic syntactic elements of first-order logic are the symbols that stand for objects, relations, and functions. -3 kinds of symbols: 1) constant symbols: which stand for objects. Ex: Richard and John 2) predicate symbols: which stand for relations. Ex: Brother, OnHead, Person, King, and Crown 3) function symbols: which stand for functions. Ex: LeftLeg. - All the objects starts with Uppercase letters.

SEMANTICS:
-The semantics must relate sentences to models in order to determine truth. -For such purpose , we need an interpretation that specifies exactly which objects, relations and functions are referred to by the constant, predicate, and function symbols. -One possible interpretation is the intended interpretation. Ex: -Richard refers to Richard the Lionheart and John refers to the evil king John. -Brother refers to the brotherhood relation, that is, the set of tuples of objects . - OnHead refers to the "on head relation that holds between the crown and King John. - Person, King, and Crown refer to the sets of objects that are persons, kings, and crowns. - LeftLeg refers to the "left leg" function.

BNF grammar of FIRST ORDER LOGIC:

TERM :
- A logical expression used as a reference for an object is called as a Term. -A term can be represented either as a constant,or a variable or a function with paranthesized list of terms as arguments.

Ex:

refers to King Johns LefLeg.

ATOMIC SENTENCES:
-A sentence formed by using the predicate symbol and Paranthesized terms as arguments is called ATOMIC SENTENCES.
- Ex: -Atomic sentences can also have complex terms as arguments. Ex:

COMPLEX SENTENCES: -They are the sentences that can be formed by using the atomic sentences using the Logical connectives. Ex:

QUANTIFIERS:
-Used to express characterisitcs of collection of objects. 2 types: 1) UNIVERSAL QUANTIFIER 2) EXISTENTIAL QUANTUFIER

UNIVERSAL QUANTIIER: -"All kings are persons,'' is written in first-order logic as

Here the symbol x is called variable.

EXISTENTIAL QUANTIIER:
-Existential quantifier refers only to some of the elements in the universe.
-

NESTED QUANTIFIERS:
Multiple Quantifiers will be used to represent the more complex sentences. Ex: 1.Brothers are Siblings 2.Everbody loves somebody

EQUALITY:
-Equality symbol represents the equality of 2 sentences. -Other than using the predicate and terms it provides another way of representing the atomic sentences. Ex:

Vous aimerez peut-être aussi