Gandhinagar Institute of Technology
[Link] Artificial Intelligence
Semester 4
Subject Code: Subject Title: Prolog Programming
Prerequisite: Discrete Mathematics, Data Structures, Fundamentals of Programming
Course Objective:
1. Understand the principles of declarative and logic programming.
2. Model real-world problems using facts, rules, and queries.
3. Apply unification, resolution, and backtracking for logical inference.
4. Implement AI-oriented applications such as expert systems and knowledge bases using Prolog.
5. Analyze the strengths and limitations of logic programming in AI systems.
Teaching Scheme (Hours per week) Evaluation Scheme (Marks)
Theory Practical
Lecture Tutorial Practical Credit Continuous Total
Continuous
University University
Assessment Assessment Assessment Assessment
3 - 2 4 70 30 30 20 150
Subject Contents
Sr. Total Weight
Topic
No Hours (%)
Introduction to Logic Programming: Programming Paradigms: Imperative vs
1 Declarative Programming, Introduction to Logic Programming, History and Applications 8 10
of Prolog in AI, Structure of a Prolog Program, Facts, Rules, and Queries, Prolog Execution
Model
Syntax, Semantics, and Unification: Atoms, Variables, Constants, and Terms,
2 Compound Terms and Functors, Unification and Pattern Matching, Resolution Principle, 10 20
Prolog Query Processing, Trace and Debugging Basics
3 Control Mechanisms and Backtracking: Backtracking Mechanism, Search Trees and 9 20
Depth-First Search, Cut Operator (!) and its Applications, Fail Predicate, Controlling
Search Space, Negation as Failure, Trees and Simple Graph Representations, Difference
Lists (Introduction)
4 Prolog for Artificial Intelligence Applications : Recursive Programming in Prolog, List 9 25
Representation and Operations, Built-in List Predicates, Accumulators and Tail Recursion
5 Prolog for Artificial Intelligence Applications : Knowledge Representation in Prolog, 9 25
Rule-Based Systems and Expert Systems, Inference Mechanisms, Simple Natural
Language Processing using Prolog, Case Study: Medical / Diagnostic Expert System,
Limitations of Prolog and Modern AI Perspective
Course Outcome:
1. Explain the syntax and semantics of Prolog and logic programming concepts.
2. Develop Prolog programs using facts, rules, recursion, and lists.
3. Apply search, backtracking, and control mechanisms in Prolog.
4. Design simple expert systems and knowledge-based AI applications.
5. Evaluate Prolog-based solutions for AI reasoning problems.
List of Textbooks:
1. Covington, M. A., “Natural Language Processing for Prolog Programmers”, Prentice Hall.
2. Blackburn, P., Bos, J., and Striegnitz, K., “Learn Prolog Now!” , College Publications.
List of Reference Books:
1. Ivan Bratko, "Prolog Programming for Artificial Intelligence", Addison-Wesley.
2. W.F. Clocksin and C.S. Mellish, "Programming in Prolog", Springer.
3. J.W. Lloyd, "Foundations of Logic Programming", Springer.
4. Russell, S. & Norvig, P., "Artificial Intelligence: A Modern Approach", Pearson
List of Suggested Experiments:
1. Introduction to SWI-Prolog Environment and Syntax
2. Writing Facts, Rules, and Queries
3. Implementation of Family Relationship Knowledge Base
4. Programs on Unification and Pattern Matching
5. Backtracking and Search Tree Visualization
6. Programs using Cut (!) and Fail Predicates
7. Recursive Programs on Lists (Length, Append, Reverse)
8. Tree and Graph Representation in Prolog
9. Rule-Based Expert System (Student Advisory / Medical Diagnosis)
10. AI Reasoning System using Prolog