org.qedeq.kernel.bo.module
Class ModuleLabels

java.lang.Object
  extended by org.qedeq.kernel.bo.module.ModuleLabels

public final class ModuleLabels
extends java.lang.Object

Maps labels of an QEDEQ module to their nodes. Knows all label names.

Author:
Michael Meyling

Constructor Summary
ModuleLabels()
          Constructs a new empty module label list.
 
Method Summary
 void addChangedRule(java.lang.String label, Rule definition, ChangedRule cr, ModuleContext context)
          Add rule definition.
 void addFunction(FunctionDefinition definition, ModuleContext context)
          Add function definition.
 void addLabel(ModuleContext context, java.lang.String label)
          Add unique label for module.
 void addNode(ModuleContext context, NodeVo node, KernelQedeqBo qedeq, QedeqNumbers data)
          Add node with certain id.
 void addPredicate(PredicateDefinition definition, ModuleContext context)
          Add predicate definition.
 void addRule(java.lang.String label, Rule definition, ModuleContext context)
          Add rule definition.
 FunctionDefinition getFunction(java.lang.String name, int argumentNumber)
          Get function definition.
 ModuleContext getFunctionContext(java.lang.String name, int argumentNumber)
          Get function context.
 java.util.Map getFunctionDefinitions()
          Get mapping of function definitions.
 KernelNodeBo getNode(java.lang.String id)
          Get node for given id.
 PredicateDefinition getPredicate(java.lang.String name, int argumentNumber)
          Get predicate definition.
 ModuleContext getPredicateContext(java.lang.String name, int argumentNumber)
          Get predicate context.
 java.util.Map getPredicateDefinitions()
          Get mapping of predicate definitions.
 ModuleReferenceList getReferences()
          Get list of external QEDEQ module references.
 Rule getRule(RuleKey key)
          Get rule definition.
 ModuleContext getRuleContext(RuleKey key)
          Get rule context.
 java.util.Map getRuleDefinitions()
          Get mapping of rule definitions.
 RuleKey getRuleKey(java.lang.String ruleName)
          Get rule key with maximum rule version.
 java.lang.String getRuleLabel(RuleKey key)
          Get node id of rule key.
 boolean isModule(java.lang.String id)
          Is the given label id a module?
 boolean isNode(java.lang.String id)
          Is the given label id a node? Local node labels are not considered.
 void resetNodesToProvedUnchecked()
          Set the state of all nodes to UNCHECKED for proved.
 void resetNodesToWellFormedUnchecked()
          Set the state of all nodes to UNCHECKED for being well formed and proved.
 void setModuleReferences(ModuleReferenceList references)
          Set list of external QEDEQ module references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleLabels

public ModuleLabels()
Constructs a new empty module label list.

Method Detail

setModuleReferences

public void setModuleReferences(ModuleReferenceList references)
Set list of external QEDEQ module references.

Parameters:
references - External QEDEQ module references.

getReferences

public ModuleReferenceList getReferences()
Get list of external QEDEQ module references.

Returns:
External QEDEQ module references.

addNode

public final void addNode(ModuleContext context,
                          NodeVo node,
                          KernelQedeqBo qedeq,
                          QedeqNumbers data)
                   throws IllegalModuleDataException
Add node with certain id. All numbers should start with 1.

Parameters:
node - Add this node.
context - The node has this context.
qedeq - Parent module the node is within.
data - Various number counters.
Throws:
IllegalModuleDataException - The id already exists (perhaps as a label) or is null.

addLabel

public final void addLabel(ModuleContext context,
                           java.lang.String label)
                    throws IllegalModuleDataException
Add unique label for module.

Parameters:
label - Add this label.
context - With this context.
Throws:
IllegalModuleDataException - The id already exists or is null.

getNode

public final KernelNodeBo getNode(java.lang.String id)
Get node for given id.

Parameters:
id - Label to search node for.
Returns:
Node for given label. Maybe null.

isNode

public final boolean isNode(java.lang.String id)
Is the given label id a node? Local node labels are not considered.

Parameters:
id - Label to search node for.
Returns:
Is this an node of this module?

isModule

public final boolean isModule(java.lang.String id)
Is the given label id a module?

Parameters:
id - Label to search module reference for.
Returns:
Is this an module reference id?

addPredicate

public void addPredicate(PredicateDefinition definition,
                         ModuleContext context)
Add predicate definition. If such a definition already exists it is overwritten.

Parameters:
definition - Definition to add.
context - Here the definition stands.

getPredicate

public PredicateDefinition getPredicate(java.lang.String name,
                                        int argumentNumber)
Get predicate definition.

Parameters:
name - Predicate name.
argumentNumber - Number of predicate arguments.
Returns:
Definition. Might be null.

getPredicateContext

public ModuleContext getPredicateContext(java.lang.String name,
                                         int argumentNumber)
Get predicate context. This is only a copy.

Parameters:
name - Predicate name.
argumentNumber - Number of predicate arguments.
Returns:
Module context. Might be null.

addFunction

public void addFunction(FunctionDefinition definition,
                        ModuleContext context)
Add function definition. If such a definition already exists it is overwritten.

Parameters:
definition - Definition to add.
context - Here the definition stands.

getFunction

public FunctionDefinition getFunction(java.lang.String name,
                                      int argumentNumber)
Get function definition.

Parameters:
name - Function name.
argumentNumber - Number of function arguments.
Returns:
Definition. Might be null.

getFunctionContext

public ModuleContext getFunctionContext(java.lang.String name,
                                        int argumentNumber)
Get function context. This is only a copy.

Parameters:
name - Function name.
argumentNumber - Number of function arguments.
Returns:
Module context. Might be null.

addRule

public void addRule(java.lang.String label,
                    Rule definition,
                    ModuleContext context)
Add rule definition. If such a definition already exists it is overwritten. Also sets the key for the maximum rule version.

Parameters:
label - Node label the rule is defined within.
definition - Definition to add.
context - Here the definition stands.

addChangedRule

public void addChangedRule(java.lang.String label,
                           Rule definition,
                           ChangedRule cr,
                           ModuleContext context)
Add rule definition. If such a definition already exists it is overwritten. Also sets the key for the maximum rule version.

Parameters:
label - Node label the rule is defined within.
definition - Here we have the new rule.
cr - New modification to an old rule.
context - Here the definition stands.

getRuleKey

public RuleKey getRuleKey(java.lang.String ruleName)
Get rule key with maximum rule version.

Parameters:
ruleName - Get maximum rule key for rule with this name.
Returns:
Rule key with maximum rule version. Might be null.

getRule

public Rule getRule(RuleKey key)
Get rule definition.

Parameters:
key - Rule key.
Returns:
Definition. Might be null.

getRuleLabel

public java.lang.String getRuleLabel(RuleKey key)
Get node id of rule key.

Parameters:
key - Rule key.
Returns:
Label. Might be null.

getRuleContext

public ModuleContext getRuleContext(RuleKey key)
Get rule context. This is only a copy.

Parameters:
key - Rule key.
Returns:
Module context. Might be null.

getPredicateDefinitions

public java.util.Map getPredicateDefinitions()
Get mapping of predicate definitions.

Returns:
Mapping of predicate definitions.

getFunctionDefinitions

public java.util.Map getFunctionDefinitions()
Get mapping of function definitions.

Returns:
Mapping of function definitions.

getRuleDefinitions

public java.util.Map getRuleDefinitions()
Get mapping of rule definitions.

Returns:
Mapping of rule definitions. Key is RuleKey, value is Rule.

resetNodesToWellFormedUnchecked

public void resetNodesToWellFormedUnchecked()
Set the state of all nodes to UNCHECKED for being well formed and proved.


resetNodesToProvedUnchecked

public void resetNodesToProvedUnchecked()
Set the state of all nodes to UNCHECKED for proved.



Copyright © 2014. All Rights Reserved.