Home About Us Departments Curriculum Facilities Alumni Examination Branch
 
 
M.Sc (Computer Science) -> M. Sc (Computer Science) -> 1 st Year-> 2 nd Semester
 
Lab 2: LISP & PROLOG

LISP : Syntax and numeric functions - Basic List manipulation function in LISP - Functions - predicates and conditionals - in part, output and local variables - iteration, recursion property list and arrays.

PROLOG : Facts, quantians, variables, conjunctions, rules, syntax, characters, operators, equality and making arithmetic, input and output.

LISP

1. Write a programme to PRINT-BOARD an auxillary procedures to print out a Chess Board configuration to place n-queens on an n X n Chess Board so that they do not threaten each other (take n=4).

2. Write a procedure that takes two cities into arguments from the network of cities and Highways and the value of "neighbours" property is a list of all the other cities for which there is a direct highway connection and puts each into a list which is the value of the neighbours property of the other write connect such if a connections is already in place, connect changes nothing and return NIL, otherwise connection veteran T.

3. Evaluate the following using LISP programme
(append^1 (abc) ( ) )
(list^1 (abc), ( ) )
(cong^1(abc) ( ) )

4. Evaluate the following forms in the order given
(set tools (list 'hammer' screwdriver))
(cong of 'pilers tools') tools
(append^1 (sawwrench) tools) tools
(set f tools ( ( append1 (sawwrench) tools )) tools

5. Write a LISP programme for a situation of COUNT-WITH-OPTIONAL parameter at work on the list.

6. Define DO-FACTORIAL, using a DO form with an empty body.

PROLOG

1. Write a PROLOG programme file called "group". Find out the names of students and for each name add a fact to the programme that specifies which group that add a rule that specifies that one person knows another if they are both in the same group.




Write queries to extract the following information
i) Whom does he/she know ?
ii) Whom does anybody know?
2. Write a PROLOG programme reverse the order of the elements in a list.
3. Write a PROLOG programme for screen oriented data base Query
4. Implements "frame" in prolog programme
5. Develop a PROLOG programme using inheritance mechanism.
6. Develop a PROLOG programme for "Factory Scheduling" as a case study.

 

Achievers Placements Newsletter Guest Book Join Us Contact Us
© All Rights Reserved