From a language standpoint, I think this is a great solution. As Jonathan
suggests, have a default knowledge base that is referenced by default, with the option to declare more knowledgebases. Each one can have facts set and queries exectued seperately. I have only a passing knowledge of Prolog, but I think this should handle Logic programming, as long as Perl facts and queries have the same elements as their Prolog equivalents.
From an internal standpoint, I think this may be slightly harder to do.
While this is a great syntax for the problem, some of the other issues David mentioned were internals oriented. Obviously, that's beyond this list, but the internal implementation of this may be a bit trickier. Sage On 5/25/06, Jonathan Lang <[EMAIL PROTECTED]> wrote:
Hmm... How about this: Treat each knowledge base as an object, with at least two methods: .fact() takes the argument list and constructs a prolog-like fact or rule out of it, which then gets added to the knowledge base. .query() takes the argument list, constructs a prolog-like query out of it, and returns a lazy list of the results. There would be a default knowledge base, meaning that you wouldn't have to explicitly state which knowledge base you're using every time you declare a fact or make a query. -- Jonathan Lang