First Order Logic in AI

First Order Logic

  • The prepositional logic only deals with the facts, that may be true or false.
  • The first order logic assumes that the world contains objects, relations and functions.
Syntax for first order logic:

  • In prepositional logic, every expression is a sentence that represents a fact.
  • First order logic includes the sentences along with terms which can represent the objects.
  • Constant symbols, variables and function symbols are used to build terms, while quantifiers and predicate symbols are used to build the sentences.
Syntax:

ConstantsA, B, C.....
FunctionsSize, Color
Variablex, a
TermsConstant, variable or function(Term..)
PredicatesTrue, False
Quantifiers∀, ∃
Atomic sentencesPredicate, Predicate(Term,…), Term=Term
Sentences¬  Sentence, Sentence ∨ Sentence, Sentence ∧ Sentence, Sentence ⇒ Sentence, Sentence ⇔ Sentence, Quantifier Variable,… Sentence

Semantics:

Lets understand with an example,
Consider the sentence “Elephants are big”.There are many ways to represent this sentence.
HasSize(Elephant, Big)
SizeOF(Elephant)= Big

Lets introduce a new syntax,
IsEqual(SizeOf(Elephant, Big), this states that a object Elephant is big, which is a useless fact in any reasoning process about the Elephants in general. So lets represent that all Elephants are big.
So, we can find FOL statement as,
  • All things that are Elephants are big.
  • For all things x, for which x is a Elephant, x is big.
  • For all things x, if x is a Elephant, then x is big.
Finally the FOL will be written as.
∀x Elephant (x) ⇒ Big(x)


Knowledge Engineering of FOL

The knowledge engineer must know about the domain to represent the important objects and relationships.

The following steps are used to develop the knowledge base:

1. Identify the problem or task.
2. Assemble the relevant knowledge to the given problem or task.
3. Decide on a vocabulary of predicates, functions and constants.
4. Encode the general knowledge about the domain and a description of the specific problem instance.
5. Apply queries to the inference procedure and get the answers.
6. Finally, debug the knowledge base.