Jubecron Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Jubecron Forum

The JUBECRON forum - Jamaican Chat, Dating, Games, Anime, and just meeting people.
 
HomePortalSearchLatest imagesRegisterLog in

 

 A simple way to recursively serch a database in prolog

Go down 
AuthorMessage
PAPoUCH
Super Elite Lv2: Jr. Vet
Super Elite Lv2: Jr. Vet
PAPoUCH


Male
Number of posts : 1860
Age : 37
Mood : A simple way to recursively serch a database in prolog Sunshine
Points : 298
Registration date : 2007-10-12

Character sheet
Weapon: Crowbar
Class: Thief Thief
HP:
A simple way to recursively serch a database in prolog Left_bar_bleue50/50A simple way to recursively serch a database in prolog Empty_bar_bleue  (50/50)

A simple way to recursively serch a database in prolog Empty
PostSubject: A simple way to recursively serch a database in prolog   A simple way to recursively serch a database in prolog Icon_minitimeTue Oct 19, 2010 8:55 pm

This exercise recursively searches the database to see if A is located in B. A and B being objects stored in the database.

% Author: Kevin Stewart 0700410
% Date: 10/19/2010

%recursion

located(flashlight, desk).
located(stamp, evelope).
located(envelope, desk).
located(key, envelope).
located(desk, office).

%base case
is_contained_in(T1, T2):- located(T1, T2).

%recursive case
is_contained_in(T1, T2):- located(T1, X), is_contained_in(X,T2).


Back to top Go down
http://www.penngosquad.forumotion.com
 
A simple way to recursively serch a database in prolog
Back to top 
Page 1 of 1
 Similar topics
-
» Prolog Exercise 1
» Prolog Lab 5
» Prolog Lab 2
» prolog lab 3
» Prolog Lab 1

Permissions in this forum:You cannot reply to topics in this forum
Jubecron Forum :: School :: Schools (General)-
Jump to: