Post

Appendix A: Lab Index and Cross-Reference

Cross-reference of lab experiments to book chapters.

Appendix A: Lab Index and Cross-Reference

Lab Index

Cross-Reference: Lab Experiments to Book Chapters

Table [tab:lab-chapter-mapping] maps each laboratory experiment from the AI Lab course (CSE 406) to the relevant theory chapters in this book.

Exp.ExperimentTopics CoveredChapter
01SWI-Prolog IntroFacts, rules, queries; family; printing; max; GPA; Fibonacci; factorialCh. [ch:prolog-intro]
02Prolog Rules/ArithmeticCube of number; list of goals; GCD/LCMCh. [ch:prolog-intro]
03Prolog ListsMembership, length, concat, delete, insert; set union/intersection; bubble sortCh. [ch:prolog-lists]
04Loops, Trees, DFARecursive loops; menus; tree traversal; DFA simulationCh. [ch:prolog-advanced]
05NFA SimulationNondeterministic FA; multiple transitions; word acceptanceCh. [ch:prolog-advanced]
06Cyclic GraphsPath finding; visited-list cycle avoidanceCh. [ch:prolog-advanced]
07File Handlingtell/told; see/seen; stream controlCh. [ch:prolog-advanced]

Lab experiments and corresponding book chapters

Prolog Programs (Index Items 11–20)

Table [tab:prolog-programs] lists the Prolog programs from the lab index.

#ProgramDescription
11Family relationshipsDefines female/1, male/1, parentof/2 facts; derives siblingof/2, brotherof/2 via shared-parent rules.
12Print listUses write/1, nl/0, fail/0 to iterate over item/1 facts.
13Max of twoCompares two numbers with >= and > to return the larger.
14GPA lookupReads a name, looks up GPA from facts, writes the result.
15Student-profRelates studies/2 and teaches/2 to find professors.
16FibonacciRecursive definition using is/2 for arithmetic on natural numbers.
17FactorialRecursive computation with accumulator pattern.
18Cube of numberRead-process loop with stop sentinel and cut (!/0).
19List of goalsMultiple clauses for dark/1: black, brown, or gray.
20GCD and LCMEuclidean GCD via recursion; LCM derived as product over GCD.

Prolog programs (lab index items 11–20)

LISP Programs (Index Items 1–5)

Table [tab:lisp-programs] lists the LISP programs from the lab index.

#ProgramDescription
1Basic LIST manipulationApplies CAR, CDR, CONS, LIST, APPEND to extract and construct lists.
2Additional manipulationUses REVERSE, LENGTH, MEMBER, SUBST, NTH for deeper list processing.
3Max and minComputes maximum/minimum of a list using recursive comparison.
4Area of circleComputes $\pi r^2$ with a simple arithmetic function in LISP.
5PutProp functionDemonstrates property lists with PUTPROP and GET to attach properties to symbols.

LISP programs (lab index items 1–5)

C++ Programs (Index Items 8–10, 23–25)

Table [tab:cpp-programs] lists the C++ programs from the lab index.

#ProgramDescription
8Breadth-First SearchExplores a graph level by level using a FIFO queue with visited marking.
9Depth-First SearchExplores recursively, visiting as far as possible before backtracking.
10A* SearchBest-first search using $f(n)=g(n)+h(n)$ with priority queue and closed set.
23DFA: starts with “101”5-state DFA: initial, three progress, accept, and dead state for reject.
24DFA: contains “10”3-state DFA tracking substring progress for pattern 10.
25DFA: odd 0’s / even 1’s4-state parity DFA with states tracking (odd0, even1) pairs.

C++ programs (lab index items 8–10, 23–25)

This post is licensed under CC BY 4.0 by the author.