|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.uml.interpreter.CycExtractor
Extracts a state machine model from the Cyc KB.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Field Summary | |
protected CycList |
argumentTerms
the argument terms for the current procedure |
protected CompositeState |
container
the container of the current state vertex |
protected CycAccess |
cycAccess
the CycAccess object which manages the Cyc server connection |
static int |
DEFAULT_VERBOSITY
The default verbosity of this object's output. |
protected org.opencyc.uml.core.Procedure |
doActivityProcedure
the doActivity procedure for the current state |
protected org.opencyc.uml.core.Procedure |
entryProcedure
the entry procedure for the current state |
protected org.opencyc.uml.core.Procedure |
exitProcedure
the exit procedure for the current state |
static java.lang.String |
mtName
the name of the relevant inference microtheory |
protected CycFort |
mtTerm
the relevant inference microtheory |
protected java.util.HashMap |
procedureDictionary
the dictionary with the key a procedureTerm and the value its Procedure |
protected CycList |
procedureTerms
the list of procedure terms |
protected CycList |
resultTerms
the result terms for the current procedure |
protected StateMachine |
stateMachine
the state machine |
protected StateMachineFactory |
stateMachineFactory
the state machine factory |
protected java.lang.String |
stateMachineName
the state machine name |
protected CycConstant |
stateMachineTerm
the state machine term |
protected java.lang.String |
stateVertexCommentString
the current state vertex comment string |
protected java.util.HashMap |
stateVertexDictionary
the dictionary with the key a stateTerm and the value its StateVertex |
protected java.lang.String |
stateVertexName
the current state vertex name |
protected CycList |
stateVertexTerms
the list of state vertex terms |
protected java.util.HashMap |
transitionDictionary
the dictionary with the key a transitionTerm and the value its Transition |
protected CycList |
transitionTerms
the list of transition terms |
protected int |
verbosity
Sets verbosity of this object's output. |
Constructor Summary | |
CycExtractor(CycAccess cycAccess)
Construct a new CycExtractor object given the CycAccess server connection. |
Method Summary | |
StateMachine |
extract(java.lang.String stateMachineName)
Extracts the state machine model specified by the given name. |
protected void |
extractCompositeState(CycConstant compositeStateTerm)
Extracts a composite state from Cyc given its Cyc term |
protected void |
extractFinalState(CycConstant finalStateTerm)
Extracts a final state from Cyc given its Cyc term |
protected void |
extractProcedures()
Extracts the procedures for the state machine from Cyc. |
protected void |
extractPseudoState(CycConstant pseudoStateTerm)
Extracts a pseudo state from Cyc given its Cyc term |
protected void |
extractSimpleState(CycConstant simpleStateTerm)
Extracts a simple state from Cyc given its Cyc term |
protected StateMachine |
extractStateMachine()
Extracts the state machine from Cyc. |
protected void |
extractStates()
Extracts the states for the state machine from Cyc. |
protected void |
extractTransitions()
Extracts the transitions for the state machine from Cyc. |
protected void |
getArgumentAndResultTerms(CycConstant procedureTerm)
Gets the argument and result terms for the given procedure term. |
protected void |
getEntryExitDoActivityProcedures(CycConstant stateTerm)
Gets the entry, exit and doActivity procedures for the given state term |
protected void |
getProcedureTerms()
Returns the procedure terms of the state machine. |
protected void |
getStateTerms()
Finds the state terms of the state machine term. |
protected void |
getTransitionTerms()
Returns the transition terms of the state machine. |
void |
setVerbosity(int verbosity)
Sets verbosity of this object's output. |
protected Event |
translateTermToEvent(CycConstant eventTerm)
Returns the Event corresponding to the given event term |
protected java.lang.Class |
translateType(CycConstant typeTerm)
Returns the java class denoted by the given Cyc type term. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_VERBOSITY
protected int verbosity
public static final java.lang.String mtName
protected CycFort mtTerm
protected CycAccess cycAccess
protected StateMachineFactory stateMachineFactory
protected CycConstant stateMachineTerm
protected java.lang.String stateMachineName
protected StateMachine stateMachine
protected CycList stateVertexTerms
protected java.util.HashMap stateVertexDictionary
protected CycList transitionTerms
protected CycList procedureTerms
protected java.util.HashMap transitionDictionary
protected java.util.HashMap procedureDictionary
protected CycList argumentTerms
protected CycList resultTerms
protected java.lang.String stateVertexName
protected java.lang.String stateVertexCommentString
protected org.opencyc.uml.core.Procedure entryProcedure
protected org.opencyc.uml.core.Procedure exitProcedure
protected org.opencyc.uml.core.Procedure doActivityProcedure
protected CompositeState container
Constructor Detail |
public CycExtractor(CycAccess cycAccess)
cycAcess
- the given CycAccess Cyc KB server connectionMethod Detail |
public StateMachine extract(java.lang.String stateMachineName) throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
stateMachineName
- the name of the state machine to be extracted from Cycprotected StateMachine extractStateMachine() throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
protected void extractProcedures() throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
protected java.lang.Class translateType(CycConstant typeTerm) throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
typeTerm
- the given type termprotected void getArgumentAndResultTerms(CycConstant procedureTerm) throws java.io.IOException, CycApiException
procedureTerm
- the given procedure termprotected void extractStates() throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
protected void extractCompositeState(CycConstant compositeStateTerm) throws java.io.IOException, CycApiException
compositeStateTerm
- the given composite state termprotected void extractPseudoState(CycConstant pseudoStateTerm) throws java.io.IOException, CycApiException
pseuodStateTerm
- the given pseudo state termprotected void extractSimpleState(CycConstant simpleStateTerm) throws java.io.IOException, CycApiException
simpleStateTerm
- the given state vertex termprotected void extractFinalState(CycConstant finalStateTerm) throws java.io.IOException, CycApiException
finalStateTerm
- the given state vertex termprotected void getStateTerms() throws java.io.IOException, CycApiException
protected void getEntryExitDoActivityProcedures(CycConstant stateTerm) throws java.io.IOException, CycApiException
state
- the given state termprotected void getTransitionTerms() throws java.io.IOException, CycApiException
protected void getProcedureTerms() throws java.io.IOException, CycApiException
protected void extractTransitions() throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
protected Event translateTermToEvent(CycConstant eventTerm) throws java.io.IOException, CycApiException, java.lang.ClassNotFoundException
eventTerm
- the given event termpublic void setVerbosity(int verbosity)
verbosity
- 0 --> quiet ... 9 -> maximum diagnostic input
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |