2. B16: First Order Logic
Created By,
Team: dccomics
Chinmay Patel (201405627)
3. Introduction
➢ First-order logic is a collection of formal systems used in mathematics,
philosophy, linguistics, and computer science. It is also known as first-order
predicate calculus or first-order functional calculus.
➢ It is used to represent knowledge. It is much more expressive as a KR language
and more commonly used in AI. It can be useful in creation of computer
programs.
➢ There are more powerful forms of logic, but first-order logic is adequate for most
everyday reasoning.
➢ There are many variations: propositional logic, horn logic, higher order logic,
three-valued logic, probabilistic logics, etc.
4. Introduction
➢ First-order logic is the standard for the formalization of mathematics into axioms
and is studied in the foundations of mathematics.
➢ First-order logic is symbolized reasoning in which each sentence, or statement, is
broken down into a subject and a predicate. The predicate modifies or defines the
properties of the subject.
➢ In first-order logic, a predicate can only refer to a single subject.
➢ First order logic contains predicates, quantifiers and variables. Variables range
over individuals(domain of discourse).
5. Propositional Logic
➢ Propositional logic is declarative. Knowledge and inference are separate. It
assumes that the world contains facts.
➢ It has a simple syntax and simple semantics. It suffices to illustrate the process
of inference.
➢ Propositional logic quickly becomes impractical, even for very small worlds. It
allows partial/disjunctive/negated information unlike most data structures and
databases.
➢ Meaning in propositional logic is context-independent unlike natural language,
where meaning depends on context.
➢ Propositional logic has very limited expressive power whereas first-order logic is
more powerful than propositional logic.
6. First-order logic (FOL) models the world in terms of
➢ Objects, which are things with individual identities
➢ Properties of objects, that distinguish them from other objects
➢ Relations, that hold among sets of objects
➢ Functions, which are a subset of relations where there is only one “value” for any
given “input”
➢ Objects: students, lectures, companies, cars, wars etc.
➢ Relations: brother-of, bigger-than, outside, part-of, has-color, occurs-after, owns,
visits, precedes etc.
➢ Properties: blue, oval, even, large etc.
➢ Functions: father-of, best-friend, second-half, one-more-than etc.
7. Syntax of First-order logic
➢ Constant symbols: (i.e., the "individuals" in the world) E.g., Mary, 3, Kingjohn
➢ Function symbols: (mapping individuals to individuals) E.g., father-of(Mary) =
John, color-of(Sky) = Blue
➢ Predicate symbols: (mapping from individuals to truth values) E.g., greater(5,3),
green(Grass), color(Grass, Green)
➢ Variable symbols: E.g., x, y, a, b
➢ Connectives: not (¬), and (∧), or (∨), implies (⇒), if and only if (⇔)
➢ Quantifiers: Universal (∀) and Existential (∃)
8. Terminology
➢ A term (denoting a real-world individual) is a constant symbol, a variable symbol,
or an n-place function of n terms. x and f(x1
, ..., xn
) are terms, where each xi
is a
term. A term with no variables is a ground term.
➢ A well-formed formula (wff) is a sentence containing no “free” variables. That is,
all variables are “bound” by universal or existential quantifiers. For example,
(∃x)P(x,y) has x bound as a universally quantified variable, but y is free.
➢ A valid sentence or tautology is a sentence that is True under all interpretations,
no matter what the world is actually like or what the semantics is. Example: “It’s
raining or it’s not raining”.
➢ An inconsistent sentence or contradiction is a sentence that is False under all
interpretations. The world is never like what it describes, as in “It’s raining and it’s
not raining.”
9. Examples
➢ King John and Richard the Lion heart are brothers. (Atomic sentence)
➢ The length of left leg of Richard is greater than the length of left leg of King John.
10. Complex Sentence
➢ An atomic sentence (which has value true or false) is an n-place predicate of n
terms.
➢ Complex sentences are made from atomic sentences using connectives: ¬S, S1
∧ S2
, S1
∨ S2
, S1
⇒ S2
, S1
⇔ S2
➢ Sibling(KingJohn,Richard) ⇒ Sibling(Richard,KingJohn)
12. Universal Quantification
➢ ∀ means “for all”
➢ Allows us to make statements about all objects that have certain properties.
Universal quantification corresponds to conjunction ("and") in that (∀x)P(x)
means that P holds for all values of x in the domain associated with that variable.
E.g. (∀x) dolphin(x) ⇒ mammal(x)
➢ Universal quantifiers are usually used with "implies" to form "if-then rules."
➢ For example,
➢ (∀x)(King(x) ∧ Person(x)) is not correct. This would imply that all objects x are
Kings and are People.
➢ (∀x)(King(x) ⇒ Person(x)) is the correct way to say this.
13. Existential Quantification
➢ ∃x means “there exists an x such that….” (at least one object x)
➢ Allows us to make statements about some object without naming it. Existential
quantification corresponds to disjunction ("or") in that (∃x)P(x) means that P
holds for some value of x in the domain associated with that variable. E.g. (∃x)
mammal(x) ∧ lays-eggs(x)
➢ Existential quantifiers are usually used with "and" to specify a list of properties or
facts about an individual. E.g. (∃i)(Integer(i) ∧ GreaterThan(i,0))
➢ Switching the order of same quantifiers does not change the meaning. Switching
the order of universals and existentials does change the meaning. E.g. Everyone
likes someone: (∀x)(∃y)likes(x,y) ; Someone is liked by everyone:
(∃y)(∀x)likes(x,y). Both are different sentences.
14. Limitations of First-Order Logic
➢ One needs to sacrifice some expressive power in order to reduce the
computational complexity of using a particular logical formalism in a real-world
scenario.
➢ FOL is a powerful language for representing knowledge. But its expressiveness
complicates the derivation of inferences. (It gets easier if we eliminate existential
quantification and assume `negation by failure'.)
➢ Expressing the degree of similarity or degree of relatedness is a major challenge
in first-order logic representation.
➢ In FOL, one cannot construct sentences which make assertions about other
sentences. For example, one cannot say things like ‘there exists a property such
that...' For this task, one needs a higher-order logic.
15. Second-order and Higher-order Logic
➢ Second-order logic is an extension of first-order logic where, in addition to
quantifiers such as “for every object (in the universe of discourse),” one has
quantifiers such as “for every property of objects (in the universe of discourse).”
➢ This augmentation of the language increases its expressive strength, without
adding new non-logical symbols, such as new predicate symbols. For classical
extensional logic (as in this entry), properties can be identified with sets, so that
second-order logic provides ones with the quantifier “for every set of objects.”
➢ According to one scheme, third-order logic allows super-predicate symbols to
occur free, and fourth-order logic allows them to be quantified. According to the
other scheme, third-order logic already allows quantification of super-predicate
symbols.
➢ A higher order logic allows predicates to accept arguments which are themselves
predicates.Second order logic cannot be reduced to first-order logic.