Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 4 — LISP and Other AI Programming Languages

Lesson 33 of 34 in the free Artificial Intelligence notes on Siksha Sarovar, written by Rohit Jangra.

LISP and Other AI Programming Languages

Classical AI systems — search programs, knowledge representation systems, and expert systems — were built with languages specifically well-suited to symbolic processing, rather than the numeric computation most languages of the era focused on. LISP is the most historically important of these.

Why AI Needed a Different Kind of Language

AI's requirementsWhat ordinary 1950s-60s languages (e.g., FORTRAN) offered
Manipulate symbols and lists (facts, rules, trees), not just numbersFocused on numeric/array computation
Dynamically build/modify programs and data (code as data)Fixed program structure, compiled once
Automatic memory management for changing, complex data structuresManual, fixed-size memory allocation
Recursive definitions matched naturally to trees/graphs used in searchRecursion often awkward or unsupported

LISP — LISt Processing

Invented by John McCarthy in 1958 (the same person who coined the term "Artificial Intelligence" at Dartmouth in 1956), LISP represents both programs and data as nested lists — a property called homoiconicity that makes it uniquely easy to write programs that write or modify other programs, a huge advantage for search and reasoning systems.

; A simple LISP function: factorial
(defun factorial (n)
  (if (= n 0)
      1
      (* n (factorial (- n 1)))))

(factorial 5)   ; => 120

; Lists as the core data structure
(setq animals (quote (cat dog bird)))
(car animals)    ; => CAT   (first element)
(cdr animals)    ; => (DOG BIRD)   (rest of the list)

Key Features of LISP

FeatureWhy it matters for AI
Lists as the universal data structureFacts, rules, trees, and even LISP programs themselves are all just lists — easy to build/manipulate uniformly
Recursion as the primary control structureMatches naturally with tree/graph search algorithms studied throughout this course
Automatic garbage collectionFrees the programmer from manual memory management while building/discarding large, changing symbolic structures
Code = dataPrograms can generate and execute new LISP code at runtime — used in some learning and meta-reasoning systems
Interactive REPL (read-eval-print loop)Encourages rapid, exploratory development — well suited to AI research

Other Classical AI Programming Languages

LanguageOriginDistinctive feature
PROLOG1972, France (Colmerauer)Logic-programming language: programs are facts + rules in predicate logic (Horn clauses); execution = automatic backward-chaining inference
SCHEME1975, MITA cleaner, minimalist dialect of LISP
OPS51970s, CMUA dedicated production-rule language used to build early expert systems (including R1/XCON)
SmallTalk1970s, Xerox PARCPioneered object-oriented programming; used in some AI environments

LISP vs PROLOG

LISPPROLOG
Programming paradigmFunctional (with imperative extensions)Logic (declarative)
A "program" isA set of function definitionsA set of facts and rules (a knowledge base)
Execution modelFunction evaluationUnification and backward-chaining inference
Best suited forGeneral symbolic AI programming, search algorithmsKnowledge representation, rule-based reasoning, natural language parsing

Why This History Still Matters

Modern AI is mostly built in Python today, but Python's list/dictionary-centric style, its garbage collection, and its dynamic typing are all design choices LISP pioneered in AI programming — and Prolog's declarative "state facts and rules, let the engine infer" model directly inspired rule-based expert-system shells (previous lesson) and constraint-solving systems (Unit 1, constraint satisfaction).