Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prolog reflection

Status
Not open for further replies.

kahleen

Programmer
Sep 4, 2008
164
CH
Hello ... I'm having the following problem ... I have a Prolog knowledge base that contains only facts like these:

alpha(6,5).
beta(7,6).
gamma(8,6).
........
and so on ....

basically, it's a generalized tree representation ... and it's guaranteed that the first parameter of each fact is unique in the entire knowledge base ... thus, there is only one fact that has first parameter = 8 (the gamma fact) ...

now, I would like to retrieve in one of my user queries the name of the fact that has as first parameter a certain number ... for example, given the number 8, i would like to obtain the name "gamma" because gamma is the only fact in the knowledge base that has 8 as its first parameter (or ID, since first parameters are unique) ... or better yet, is there a way to obtain the whole term gamma(8,6)?

thanks in advance for your time ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top