Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

XSBPool Class Reference

An XSBPool is a Pool with various XSB-enabled tricks. More...

#include <XSBPool.h>

Inheritance diagram for XSBPool::

DeductivePool QueryablePool Pool TripleSource TripleSink Collaboration diagram for XSBPool:

Collaboration graph
[legend]
List of all members.

Public Methods

Friends


Detailed Description

An XSBPool is a Pool with various XSB-enabled tricks.

The data is stored in an InMemoryPool and also as prolog facts in a file. The file is updated by the agent calling sync(), which it should do prior to any queries. In theory we could keep track of changes and update the file more efficiently and/or even assert() to the XSB pipe. In fact, XSB's compile/cache system is probably good enough for most apps.

We might want a flag about whether the database should be compiled.

Definition at line 24 of file XSBPool.h.


Member Function Documentation

Triple XSBPool::fetch Triple    simplePattern,
LoopState   loopState,
unsigned long    max_results = 0
const [inline, virtual]
 

Get the first triple which matches the pattern, and then (on following calls) get the next matching triples.

max_results is a hint which can improve performance if you know ahead of time that you will not be iterating more than some number of times.

Reimplemented from TripleSource.

Definition at line 43 of file XSBPool.h.

Query* XSBPool::query const TripleSource   pattern [inline, virtual]
 

Create a new query, trying to match the given pattern.

The formal semantics of the query are "does the formula ('this') logically entail the formula 'pattern'?" (If it does, then I might want proof or maybe just some bindings.) The different kinds of queries one might want correspond to different kinds of logical entailment. If the query allows variables in the pattern to match constants in the pool (not just variables in the pool), that means the entailment proceedure includes existential instantiation. Variables in the pool matching constants in the pattern would be like "someone has a car" entailing "Sam has a car", which is probably not what you want.

Note:
Some pools (eg XSBPool) can only support one query per Agent. Calling query() again before the previous one has been closed is an error.
Returns:
a pointer to a new Query object, which you should delete when you're done.

Reimplemented from QueryablePool.

Definition at line 48 of file XSBPool.h.

void XSBPool::remove Triple    t [inline, virtual]
 

Remove the given triple, if it happens to be present.

No operation otherwise.

Reimplemented from Pool.

Definition at line 52 of file XSBPool.h.

void XSBPool::replace Symbol    old,
Symbol    replacement
[inline, virtual]
 

Replace any occurances of 'old' with 'replacement'.

Caller should treat 'old' as if it had been released.

See also:
Symbol::release Symbol.release release

Reimplemented from Pool.

Definition at line 57 of file XSBPool.h.


Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:37 2001.