org.semanticweb.HermiT
Class RoleBox

java.lang.Object
  extended by org.semanticweb.HermiT.RoleBox

public class RoleBox
extends java.lang.Object


Nested Class Summary
static class RoleBox.NotRegularException
           
static interface RoleBox.RoleRewriter
          The callback interface for the rewriteRole method.
 
Field Summary
private  java.util.Set<java.lang.Integer> m_acceptingStates
           
private  java.util.Map<Role,Role> m_canonicalNames
           
private  java.util.Map<Role,java.lang.Integer> m_initialStates
           
private  java.util.Set<Role> m_symmetricRoles
           
private  java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Set<Role>>> m_transitions
           
 
Constructor Summary
RoleBox(java.util.Map<Role,java.util.Set<java.util.List<Role>>> definitions)
          Constructs a RoleBox from a collection of role axioms.
 
Method Summary
protected  Role canonical(Role r)
           
 boolean isComplex(Role r)
           
 java.lang.Integer rewriteRole(Role role, RoleBox.RoleRewriter rewriter, java.util.Set<java.lang.Integer> visited)
          Uses the provided rewriter to describe the role paths which induce a given role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_canonicalNames

private java.util.Map<Role,Role> m_canonicalNames

m_symmetricRoles

private java.util.Set<Role> m_symmetricRoles

m_transitions

private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Set<Role>>> m_transitions

m_initialStates

private java.util.Map<Role,java.lang.Integer> m_initialStates

m_acceptingStates

private java.util.Set<java.lang.Integer> m_acceptingStates
Constructor Detail

RoleBox

public RoleBox(java.util.Map<Role,java.util.Set<java.util.List<Role>>> definitions)
Constructs a RoleBox from a collection of role axioms.

Parameters:
definitions - a map from each role to role sequences which imply that role i.e. if R is transitive then [R, R] would be a member of the collection associated with R.
Method Detail

canonical

protected Role canonical(Role r)

isComplex

public boolean isComplex(Role r)

rewriteRole

public java.lang.Integer rewriteRole(Role role,
                                     RoleBox.RoleRewriter rewriter,
                                     java.util.Set<java.lang.Integer> visited)
Uses the provided rewriter to describe the role paths which induce a given role. The description is in the form of a "state machine" with integers representing states. It is possible that the same integer is used in callbacks generated by different calls, with different role arguments, to this method; such an integer refers to the same state in all cases. (The automata for different roles may intersect.)

Returns:
The initial state of the automaton for the given role.