public class LPInterpreter extends Object
Constructor and Description |
---|
LPInterpreter(LPBRuleEngine engine,
TriplePattern goal)
Constructor used to construct top level calls.
|
LPInterpreter(LPBRuleEngine engine,
TriplePattern goal,
boolean isTop)
Constructor.
|
LPInterpreter(LPBRuleEngine engine,
TriplePattern goal,
List<RuleClauseCode> clauses,
boolean isTop)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(Node var,
Node val)
Bind a value to a variable, recording the binding in the trail.
|
void |
close()
Stop the current work.
|
static Node |
deref(Node node)
Dereference a node, following any binding trail.
|
static Triple |
deref(TriplePattern t)
Return a dereferenced copy of a triple.
|
static Node |
derefPossFunctor(Node node)
Dereference a node which may be a functor node
|
FrameObject |
getChoiceFrame()
Return the current choice point frame that can be used to restart the
interpter at this point.
|
LPInterpreterContext |
getContext()
Return the context in which this interpreter is running, that is
either the Generator for a tabled goal or a top level iterator.
|
LPBRuleEngine |
getEngine()
Return the engine which owns this interpreter.
|
static boolean |
isGrounded(Node node)
Check if a node values is now grounded
|
Object |
next()
Return the next result from this engine, no further initialization.
|
void |
preserveState(ConsumerChoicePointFrame ccp)
Preserve the current interpter state in the consumer choice point at the top
of the choice point tree.
|
void |
restoreState(ConsumerChoicePointFrame ccp)
Restore the interpter state according to the given consumer choice point.
|
void |
setState(LPInterpreterState state)
Start the interpreter running with the given context.
|
void |
setTopInterpreter(LPInterpreterContext context)
Called by top level interpreter to set to execution context for this interpreter to be
top level instead of an internal generator.
|
boolean |
unify(Node n1,
Node n2)
Unify two nodes.
|
void |
unwindTrail(int mark)
Unwind the trail to given low water mark
|
public LPInterpreter(LPBRuleEngine engine, TriplePattern goal)
engine
- the engine which is calling this interpretergoal
- the query to be satisfiedpublic LPInterpreter(LPBRuleEngine engine, TriplePattern goal, boolean isTop)
engine
- the engine which is calling this interpretergoal
- the query to be satisfiedisTop
- true if this is a top level call from the outside iterator, false means it is an
internal generator call which means we don't need to insert an tabled callpublic LPInterpreter(LPBRuleEngine engine, TriplePattern goal, List<RuleClauseCode> clauses, boolean isTop)
engine
- the engine which is calling this interpretergoal
- the query to be satisfiedclauses
- the set of code blocks needed to implement this goalisTop
- true if this is a top level call from the outside iterator, false means it is an
internal generator call which means we don't need to insert an tabled callpublic void setTopInterpreter(LPInterpreterContext context)
public void close()
public void setState(LPInterpreterState state)
public Object next()
public LPBRuleEngine getEngine()
public FrameObject getChoiceFrame()
public LPInterpreterContext getContext()
public void preserveState(ConsumerChoicePointFrame ccp)
public void restoreState(ConsumerChoicePointFrame ccp)
public boolean unify(Node n1, Node n2)
public void bind(Node var, Node val)
var
- the dereferenced variable to be boundval
- the value to bind to itpublic void unwindTrail(int mark)
public static boolean isGrounded(Node node)
public static Triple deref(TriplePattern t)
Licenced under the Apache License, Version 2.0