EXE-3 - Generate your own different queries to test above...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecturer: Aasma Memon [ CPCS-331 ] Prolog –Lab Exercise 3 This practical is about writing a program to incorporate information about the location of people Q1. Write predicates to include the following information Helen has room F5 Frank has room E6 Paul has room F9 Han has room E6 Robert has room F9 Dave has room E10 Henry has room E12 Janet has room E11 Sara has room E13 Ross has room F10 Write a predicate room with 2 arguments name and room number . room(name,room number).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Generate your own different queries to test above predicate Q2. Add some more clauses to store telephone number for each room. Use a predicate phone with two arguments, 1 st argument should be room number , second should be extension Phone(room number, extension) Lecturer: Aasma Memon [ CPCS-331 ] Write this rule here Ring(P,N):-room(P,R),phone(R.N). Visiting(alan,Helen) Find(X.Z):- visiting(X,Y),room(Y,Z). Q3....
View Full Document

Page1 / 2

EXE-3 - Generate your own different queries to test above...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online