๐Ÿค–
B.TECH II YEAR โ€ข II SEMESTER โ€ข CSE

Skill Development Course - Lab Manual

R22 Lab Manual โ€ข PROLOG / LISP / PySWIP

LAB MANUAL

Skill Development Course (Prolog) Lab Programs

This tutorial provides Lab Programs on various topics of Skill Development Course (Prolog). It includes simple facts and predicates, the Monkey Banana problem, medical diagnosis with cuts, the 4-Queens, Traveling Salesman and water jug problems, list operations, binary search trees and counting with accumulators.

๐Ÿค–

Prolog / LISP / PySWIP Lab Programs

11 Programs
01

Write simple fact for following: A. Ram likes mango. B. Seema is a girl. C. Bill likes Cindy. D. Rose is red. E. John owns gold

View Solution โ†’
02

Write predicates one converts centigrade temperatures to Fahrenheit, the other checks if a temperature is below freezing.

View Solution โ†’
04

WAP in turbo prolog for medical diagnosis and show the advantages and disadvantages of green and red cuts.

View Solution โ†’
08

Write simple Prolog functions such as the following. Take into account lists which are too short. -- remove the Nth item from the list. -- insert as the Nth item.

View Solution โ†’
09

Assume the prolog predicate gt(A, B) is true when A is greater than B. Use this predicate to define the predicate addLeaf(Tree, X, NewTree) which is true if NewTree is the Tree produced by adding the item X in a leaf node. Tree and NewTree are binary search trees. The empty tree is represented by the atom nil.

View Solution โ†’
10

Write a Prolog predicate, countLists(Alist, Ne, Nl), using accumulators, that is true when Nl is the number of items that are listed at the top level of Alist and Ne is the number of empty lists. Suggestion: First try to count the lists, or empty lists, then modify by adding the other counter.

View Solution โ†’
11

Define a predicate memCount(AList,Blist,Count) that is true if Alist occurs Count times within Blist. Define without using an accumulator. Use "not" as defined in utilities.pro, to make similar cases are unique, or else you may get more than one count as an answer.

View Solution โ†’