dpvis.dpProcessor
Class AbstractProcessor

java.lang.Object
  extended by dpvis.dpProcessor.AbstractProcessor
All Implemented Interfaces:
DPProcessor, java.io.Serializable

public abstract class AbstractProcessor
extends java.lang.Object
implements DPProcessor

See Also:
Serialized Form

Constructor Summary
AbstractProcessor()
           
 
Method Summary
static java.util.Set<Rule> computeUseableRules(RewriteSystem system, java.util.Set<java.lang.String> definedSymbols)
          Computes the usable rules for the given function symbols.
 void freeResources()
          Convenience implementation of the freeResources method that does actually nothing.
static java.util.Set<java.lang.String> getDefinedFunctions(java.util.Collection<Rule> rules, java.util.List<java.lang.String> allDefinedFunctions)
          Gets the defined function symbols that occur in the right hand side of one of the given rules.
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterDescription()
          Default implementation for this method.
 void setParameters(java.util.Map<java.lang.String,java.lang.String> params)
          Default implementation for this method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dpvis.dpProcessor.DPProcessor
getOutput, isComplete, process
 

Constructor Detail

AbstractProcessor

public AbstractProcessor()
Method Detail

getDefinedFunctions

public static java.util.Set<java.lang.String> getDefinedFunctions(java.util.Collection<Rule> rules,
                                                                  java.util.List<java.lang.String> allDefinedFunctions)
Gets the defined function symbols that occur in the right hand side of one of the given rules.

Parameters:
rules - The rules whose function symbols of the right-hand sides shall be taken.
allDefinedFunctions - The defined function symbols for which it shall be searched.
Returns:
The defined function symbols that occur in the right hand side of one of the given rules.

computeUseableRules

public static java.util.Set<Rule> computeUseableRules(RewriteSystem system,
                                                      java.util.Set<java.lang.String> definedSymbols)
Computes the usable rules for the given function symbols. These rules are the ones defining one of the given functions, or a function depending on such a function, where a function f depends on another function g if a rule defining g contains f in its right-hand side (of course the transitive closure of this relation is actually used).

Parameters:
system - The rewrite system whose usable rules shall be computed.
definedSymbols - The defined functions that are used to compute the usable rules.
Returns:
the usable rules.

freeResources

public void freeResources()
Convenience implementation of the freeResources method that does actually nothing. If your processor does not use any external resources it need not overwrite this method.

Specified by:
freeResources in interface DPProcessor

getParameterDescription

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterDescription()
Default implementation for this method. Use this method (i.e. do not overwrite it) only if your custom processor does not provide any parameterisation.

Specified by:
getParameterDescription in interface DPProcessor
Returns:
A map describing possible parameters for this processor

setParameters

public void setParameters(java.util.Map<java.lang.String,java.lang.String> params)
Default implementation for this method. Use this method (i.e. do not overwrite it) only if your custom processor does not provide any parameterisation.

Specified by:
setParameters in interface DPProcessor
Parameters:
params - The parameters.