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!

Check existance of procedures/facts

Status
Not open for further replies.

sunrain

Programmer
Feb 9, 2009
2
Hello,

I have a set of facts (a(c1), b(c2), ...) in my knowledge base that might not always be there. My set of rules 'assume' that all facts exist. If one of the facts does not exist (i.e. b(c2) is missing), when I run my program I get an error saying that I have an "Undefined procedure: b/1" which makes sense because I am using b which is undefined. When writing my rules, how can I check if specific facts (procedures) exist?

Thank you,
Mihai
 
After searching a little, I found that using the dynamic directive solves my problem.

Mihai
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top