Java Doc for LPInterpreter.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » rulesys » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner.rulesys.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.reasoner.rulesys.impl.LPInterpreter

LPInterpreter
public class LPInterpreter (Code)
Bytecode interpeter engine for the LP version of the backward chaining rule system. An instance of this is forked off for each parallel query.
author:
   Dave Reynolds
version:
   $Revision: 1.15 $ on $Date: 2008/01/02 12:06:17 $


Field Summary
protected  Node[]argVars
    
protected  RuleContextcontext
    
protected  FrameObjectcpFrame
    
protected  LPBRuleEngineengine
    
protected  EnvironmentFrameenvFrame
    
protected  TriplePatterngoal
    
protected  LPInterpreterContextiContext
    
protected  booleanisComplete
    
static  Loglogger
    
protected  Node[]pVars
    
protected  Node[]tVars
    
protected  TopLevelTripleMatchFrametopTMFrame
    
protected  ArrayListtrail
    

Constructor Summary
public  LPInterpreter(LPBRuleEngine engine, TriplePattern goal)
     Constructor used to construct top level calls.
public  LPInterpreter(LPBRuleEngine engine, TriplePattern goal, boolean isTop)
     Constructor.
public  LPInterpreter(LPBRuleEngine engine, TriplePattern goal, List clauses, boolean isTop)
     Constructor.

Method Summary
public  voidbind(Node var, Node val)
     Bind a value to a variable, recording the binding in the trail.
public  voidclose()
     Stop the current work.
public static  Nodederef(Node node)
     Derefernce a node, following any binding trail.
public static  Triplederef(TriplePattern t)
     Return a dereferenced copy of a triple.
public static  NodederefPossFunctor(Node node)
    
public  FrameObjectgetChoiceFrame()
     Return the current choice point frame that can be used to restart the interpter at this point.
public  LPInterpreterContextgetContext()
     Return the context in which this interpreter is running, that is either the Generator for a tabled goal or a top level iterator.
public  LPBRuleEnginegetEngine()
     Return the engine which owns this interpreter.
public static  booleanisGrounded(Node node)
    
public  Objectnext()
     Return the next result from this engine, no further initialization.
public  voidpreserveState(ConsumerChoicePointFrame ccp)
     Preserve the current interpter state in the consumer choice point at the top of the choice point tree.
public  voidrestoreState(ConsumerChoicePointFrame ccp)
     Restore the interpter state according to the given consumer choice point.
protected  StateFlagrun()
     Restore the current choice point and restart execution of the LP code until either find a successful branch (in which case exit with StateFlag.ACTIVE and variables bound to the correct results) or exhaust all choice points (in which case exit with StateFlag.FAIL and no bound results).
public  voidsetState(LPInterpreterState state)
     Start the interpreter running with the given context.
public  voidsetTopInterpreter(LPInterpreterContext context)
     Called by top level interpeter to set to execution context for this interpeter to be top level instead of an internal generator.
public  booleanunify(Node n1, Node n2)
     Unify two nodes.
public  voidunwindTrail(int mark)
    

Field Detail
argVars
protected Node[] argVars(Code)
The set of argument variables (Ai) in use by this interpreter



context
protected RuleContext context(Code)
The execution context description to be passed to builtins



cpFrame
protected FrameObject cpFrame(Code)
The current choice point frame



engine
protected LPBRuleEngine engine(Code)
The engine which is using this interpreter



envFrame
protected EnvironmentFrame envFrame(Code)
The current environment frame



goal
protected TriplePattern goal(Code)
Original set up goal, only used for debugging



iContext
protected LPInterpreterContext iContext(Code)
The execution context that should be notified of suspended branches



isComplete
protected boolean isComplete(Code)
True if the engine has terminated



logger
static Log logger(Code)



pVars
protected Node[] pVars(Code)
The set of "permanent" variables (Yi) in use by this interpreter



tVars
protected Node[] tVars(Code)
The set of temporary variables (Ti) in use by this interpreter



topTMFrame
protected TopLevelTripleMatchFrame topTMFrame(Code)
Trick to allow the very top level triple lookup to return results with reduced store turnover



trail
protected ArrayList trail(Code)
The trail of variable bindings that have to be unwound on backtrack




Constructor Detail
LPInterpreter
public LPInterpreter(LPBRuleEngine engine, TriplePattern goal)(Code)
Constructor used to construct top level calls.
Parameters:
  engine - the engine which is calling this interpreter
Parameters:
  goal - the query to be satisfied



LPInterpreter
public LPInterpreter(LPBRuleEngine engine, TriplePattern goal, boolean isTop)(Code)
Constructor.
Parameters:
  engine - the engine which is calling this interpreter
Parameters:
  goal - the query to be satisfied
Parameters:
  isTop - true if this is a top level call from the outside iterator, false means it is aninternal generator call which means we don't need to insert an tabled call



LPInterpreter
public LPInterpreter(LPBRuleEngine engine, TriplePattern goal, List clauses, boolean isTop)(Code)
Constructor.
Parameters:
  engine - the engine which is calling this interpreter
Parameters:
  goal - the query to be satisfied
Parameters:
  clauses - the set of code blocks needed to implement this goal
Parameters:
  isTop - true if this is a top level call from the outside iterator, false means it is aninternal generator call which means we don't need to insert an tabled call




Method Detail
bind
public void bind(Node var, Node val)(Code)
Bind a value to a variable, recording the binding in the trail.
Parameters:
  var - the dereferenced variable to be bound
Parameters:
  val - the value to bind to it



close
public void close()(Code)
Stop the current work. This is called if the top level results iterator has either finished or the calling application has had enough.



deref
public static Node deref(Node node)(Code)
Derefernce a node, following any binding trail.



deref
public static Triple deref(TriplePattern t)(Code)
Return a dereferenced copy of a triple.



derefPossFunctor
public static Node derefPossFunctor(Node node)(Code)
Derefernce a node which may be a functor node



getChoiceFrame
public FrameObject getChoiceFrame()(Code)
Return the current choice point frame that can be used to restart the interpter at this point.



getContext
public LPInterpreterContext getContext()(Code)
Return the context in which this interpreter is running, that is either the Generator for a tabled goal or a top level iterator.



getEngine
public LPBRuleEngine getEngine()(Code)
Return the engine which owns this interpreter.



isGrounded
public static boolean isGrounded(Node node)(Code)
Check if a node values is now grounded



next
public Object next()(Code)
Return the next result from this engine, no further initialization. Should be called from within an appropriately synchronized block.
Parameters:
  context - the generator choice point or top level iterator which is requesting this result and might have preserved state to restore either a StateFlag or a result Triple



preserveState
public void preserveState(ConsumerChoicePointFrame ccp)(Code)
Preserve the current interpter state in the consumer choice point at the top of the choice point tree.



restoreState
public void restoreState(ConsumerChoicePointFrame ccp)(Code)
Restore the interpter state according to the given consumer choice point.



run
protected StateFlag run()(Code)
Restore the current choice point and restart execution of the LP code until either find a successful branch (in which case exit with StateFlag.ACTIVE and variables bound to the correct results) or exhaust all choice points (in which case exit with StateFlag.FAIL and no bound results). In future tabled version could also exit with StateFlag.SUSPEND in cases whether the intepreter needs to suspend to await tabled results from a parallel proof tree.



setState
public void setState(LPInterpreterState state)(Code)
Start the interpreter running with the given context.



setTopInterpreter
public void setTopInterpreter(LPInterpreterContext context)(Code)
Called by top level interpeter to set to execution context for this interpeter to be top level instead of an internal generator.



unify
public boolean unify(Node n1, Node n2)(Code)
Unify two nodes. Current implementation does not support functors. true if the unifcation succeeds



unwindTrail
public void unwindTrail(int mark)(Code)
Unwind the trail to given low water mark



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w___w__w_.___j___a___v__a2_s___._co___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.