Skip to main content

First Order Predicate Logic

  • Chapter
  • First Online:
Fundamentals of Artificial Intelligence

Abstract

The first order predicate logic (FOPL) is backbone of AI, as well a method of formal representation of Natural Language (NL) text. The Prolog language for AI programming has its foundations in FOPL. The chapter demonstrates how to translate NL to FOPL in the form of facts and rules, use of quantifiers and variables, syntax and semantics of FOPL, and conversion of predicate expressions to clause forms. This is followed with unification of predicate expressions using instantiations and substitutions, compositions of substitutions, unification algorithm and its analysis. The resolution principle is extended to FOPL, a simple algorithm of resolution is presented, and use of resolution is demonstrated for theorem proving. The interpretation and inferences of FOPL expressions are briefly discussed, along with the use of Herbrand’s universe and Herbrand’s theorem. At the end, the most general unifier (mgu) and its algorithms are presented, and chapter is concluded with summary.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 84.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    A string of quantifiers followed by a quantifier-free part, e.g., \(\forall x_1 \dots \forall x_n \psi (x_1 \ldots , x_n)\).

References

  1. Chowdhary KR (2015) Fundamentals of discrete mathematical structures, 3rd edn. EEE, PHI India

    MATH  Google Scholar 

  2. Davis M, Putnam H (1960) A computing procedure for quantification theory. J ACM 7(3):201–215. https://doi.org/10.1145/321033.321034

  3. Emden V, Kowalki RA (1976) The semantics of predicate logic as a programming language. J ACM 23(4):733–742

    Article  MathSciNet  Google Scholar 

  4. Av Gelder et al (1991) The well-founded semantics for general logic programs. J ACM 38(3):620–650

    MathSciNet  Google Scholar 

  5. Luckham D, Nilsson NJ (1971) Extracting information from resolution trees. Artif Intell 2:27–54

    Article  MathSciNet  Google Scholar 

  6. Nilsson NJ (1980) Principles of artificial intelligence, 3rd edn. Narosa, New Delhi

    MATH  Google Scholar 

  7. Robinson JA (1963) Theorem-proving on the computer. J ACM 10(2):163–174

    Article  MathSciNet  Google Scholar 

  8. Robinson JA (1965) A machine-oriented logic, based on the resolution principle. J ACM 12(1):23–41

    Article  MathSciNet  Google Scholar 

  9. Stickel ME (1981) A unification algorithm for associative-commutative functions. J ACM 28(3):423–434

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to K. R. Chowdhary .

Exercises

Exercises

  1. 1.

    Apply the Resolution theorem to prove:

    • “Socrates is mortal”, given that

    • All men are mortal, and

    • Socrates is man.

  2. 2.

    What are the other methods for automated theorem proving? Explain any three in brief.

  3. 3.

    Convert the following into clause form:

    $$\begin{aligned} \forall x[p(x) \wedge q(x)] \Rightarrow [R(x, I) \wedge \exists y (\exists z~r(y,z) \end{aligned}$$
    $$\begin{aligned} \Rightarrow S(x,y))] \vee \forall x~T(x). \end{aligned}$$
  4. 4.

    Show that a formula in CNF is valid if and only if each of its disjunctions contains a pair of complementary literals P and \(\lnot P\).

  5. 5.

    Prove or disprove the followings:

    1. a.

      If S is a first-order formula, then S is valid iff \( S \rightarrow \bot \) is contradiction.

    2. b.

      If S is a first-order formula and x is a variable, then S is contradiction iff \(\exists x S\) is a contradiction.

  6. 6.

    Using the resolution principle prove the validity of following formula:

    $$\begin{aligned}&\forall x \exists y (p(f(f(x)), y) \wedge \forall z (p(f(x), z) \\&\rightarrow p(x, g(x, z)))) \rightarrow \forall x \forall y~p(x, y). \end{aligned}$$
  7. 7.

    Is the predicate logic deterministic or nondetermnistic programming language? justify for yes / no.

  8. 8.

    Consider a set of statements of FOPL that uses two 1-place predicates: Large and Small. The set of object constants are ab. Find out all possible models for this program. For each of the following sentences find out the models in which each of the sentence becomes true.

    1. a.

      \(\forall x~Large(x)\).

    2. b.

      \(\forall x~\lnot Large(x)\).

    3. c.

      \(\exists x~Large(x)\).

    4. d.

      \(\exists x~\lnot Large(x)\).

    5. e.

      \(Large(a) \wedge Large(b)\).

    6. f.

      \(Large(a) \vee Large(b)\).

    7. g.

      \(\forall x~[Large(x) \wedge Small(x)]\).

    8. h.

      \(\forall x~[Large(x) \vee Small(x)]\).

    9. i.

      \(\forall x~[Large(x) \Rightarrow \lnot Small(x)]\).

  9. 9.

    Find out the clauses for the following FOPL formulas.

    1. a.

      \(\exists x \forall y \exists z (P(x) \Rightarrow (Q(y) \Rightarrow R(z)))\).

    2. b.

      \(\forall x \forall y ((P(x) \wedge Q(y)) \Rightarrow \exists z R(x, y, z))\).

  10. 10.

    Define the required predicates and represent the following sentences in FOPL.

    1. a.

      Some students opted Sanskrit in fall 2015.

    2. b.

      Every student who opts Sanskrit passes it.

    3. c.

      Only one student opted Tamil in fall 2015.

    4. d.

      The best score in Sanskrit is always higher than the best score in Tamil.

    5. e.

      There is a barber in a village who shaves every one in the village who does not shave himself / herself.

    6. f.

      A person born in country X, each of whose parents is a citizen of X or a resident of X, is also a resident of X.

  11. 11.

    Determine whether the expression p and q unify with each other in each of the following cases. If so, give the mgu, if not justify it. The lowercase letters are variables, and upper are predicate, functions, and literals.

    1. a.

      \(p = f(x_1, g(x_2, x_3), x_2, b);~q = f(g(h(a, x_5), x_2), x_1,\) h(a\(x_4), x_4)\).

    2. b.

      \(p = f(x, f(u, x));~ q= f(f(y, a), f(z, f(b, z)))\).

    3. c.

      \(p = f(g(v), h(u, v));~q = f(w, j(x, y))\).

  12. 12.

    What can be the strategies for combination of clauses in resolution proof? For example, if there are N clauses, in how many ways they can be combined?

  13. 13.

    Why resolution based inference is more efficient compared modus-ponens?

  14. 14.

    Let \(\varGamma \) is knowledge base and \(\alpha \) is inference from \(\varGamma \). Give a comparison among the following inferences, in terms of their performances:

    1. a.

      Proof by Resolution, i.e., \(\varGamma \vdash \alpha \),

    2. b.

      Proof by Modus poenes, i.e., \(\varGamma \vdash \alpha \),

    3. c.

      Proof by Resolution Refutation, i.e., \(\varGamma \cup \{\lnot \alpha \} \vdash \phi \).

  15. 15.

    Given n number of clauses, draw a resolution proof tree to demonstrate combining them. Suggest any two strategies.

  16. 16.

    Given the knowledge base in clausal form, is it possible to extract answers from that making use of resolution principle? For example, finding an answer like, “Where is Tajmahal located?”

  17. 17.

    Represent the following set of statements in predicate logic, convert them to clause from, then apply the resolution proof to answer the question : Did Ranjana kill Lekhi?

    “Rajan owns a pat. Every pat owner is an animal lover. No animal lover ever kills an animal. Either Rajan or Ranjana killed a pat, called Lekhi.”

  18. 18.

    Explain:

    1. a.

      Unification

    2. b.

      Skolemization

    3. c.

      Resolution principle versus resolution theorem proving.

  19. 19.

    Use resolution to show that the following set of clauses is unsatisfiable.

    $$\begin{aligned} \{p(a, z), \lnot p(f(f(a)), a), \lnot p(x, g(y)) \vee p(f (x), y)\}. \end{aligned}$$
  20. 20.

    Derive \(\bot \) from the following set of clauses using the resolution principle.

    $$\begin{aligned} \{p(a) \vee p(b), \lnot p(a) \vee p(b), p(a) \vee \lnot p(b), \lnot p(a) \vee \lnot p(b)\}. \end{aligned}$$
  21. 21.

    Give resolution proofs for the inconsistency \(\forall x shaves(Barber, x) \rightarrow \lnot shaves(x, x)\), where Barber is a constant.

  22. 22.

    Consider ab locks-world described by facts and rules:

    Facts:

    • ontable(a), ontable(c), on(dc), on(ba), heavy(b), 

    • cleartop(e), cleartop(d), heavy(d), wooden(b), on(eb).

    Rules:

    • All blocks with clear top are black.

    • All wooden blocks are black.

    • Every heavy and wooden block is big.

    • Every big and black block is on a green block.

    Making use of resolution theorem find out the block that is on the green block.

  23. 23.

    Given the following knowledge base:

    • If x is on top of y then y supports x.

    • If x is above y and they are touching each other then x is on top of y.

    • A phone is above a book.

    • A phone is touching a book.

    Translate the above knowledge base into clause form, and use resolution to show that the predicate “supports(book, phone)” is true.

  24. 24.

    How resolution can be used to show that a sentence is:

    1. a.

      Valid?

    2. b.

      Unsatisfiable?

  25. 25.

    “The application of resolution principle for theorem proving is a non-deterministic approach.” justify this statement.

  26. 26.
    1. a.

      Use Herbrand’s method to show that formula,

      $$\begin{aligned} \forall x shaves(barber, x) \rightarrow \lnot shaves(x, x) \end{aligned}$$

      is unsatisfiable?

    2. b.

      What is Herband’s universe for \(S=\{P(a), \lnot P(f(x)) \vee P(g(x))\}\)?

  27. 27.

    Prove that \(\forall x \lnot p(x)\) and \(\lnot \exists x~p(x)\) are equivalent statements.

  28. 28.

    Let S and T be unification problems. Also, let \(\sigma \) be a most general unifier for S and \(\theta \) be a most general unifier for \(\sigma (T)\). Show that \(\theta \sigma \) is a most general unifier for \(S \cup T\).

  29. 29.

    Write the axioms describing predicates: grandchild, grandfather, grandmother, soninlaw, fatherinlaw, brother, daughter, aunt, uncle, brotherinlaw, and firstcousin.

  30. 30.

    For each pair of atomic sentences in the following, find out the most general unifier.

    1. a.

      knows(father(y), y) and knows(xx).

    2. b.

      \(\{f(x, g(x)) = y, h(y) = h(v), v = f(g(z), w)\}\).

    3. c.

      p(abb) and p(xyz).

    4. d.

      q(yg(ab)) and q(g(xx), y).

    5. e.

      older(father(y), y) and older(father(x), ram).

  31. 31.

    Explain what is wrong with the below given definition of set membership predicate \(\in \):

    $$\begin{aligned}&\forall x, s: x \in \{ x \mid s \}\\&\forall x, s: x \in s \Rightarrow \forall y: x \in \{ y \mid s \}. \end{aligned}$$
  32. 32.

    Consider the following riddle: “Brothers and sisters have I none, but that man’s father is my father’s son”. Use the rules of kinship relations to show who that man is?

  33. 33.

    Let the following be a set of facts and rules:

    Rita, Sat, Bill, and Eden are the only members of a club.

    Rita is married to Sat.

    Bill is Eden’s brother.

    Spouse of every married person in the club is also in the club.

    1. a.

      Represent the above facts and rules using predicate logic.

    2. b.

      Show that they do not conclude “Eden is not married.”

    3. c.

      Add some some more facts, and show that now the augmented set conclude that Eden is not married.

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature India Private Limited

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Chowdhary, K.R. (2020). First Order Predicate Logic. In: Fundamentals of Artificial Intelligence. Springer, New Delhi. https://doi.org/10.1007/978-81-322-3972-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-81-322-3972-7_3

  • Published:

  • Publisher Name: Springer, New Delhi

  • Print ISBN: 978-81-322-3970-3

  • Online ISBN: 978-81-322-3972-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics