dpvis.dpProcessor
Class AbstractCSProcessor

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

public abstract class AbstractCSProcessor
extends java.lang.Object
implements ContextSensitiveDpProcessor

Abstract class implementing DPProcessor providing some utility methods for the generation of the html output of a concrete processor

Author:
felixs
See Also:
Serialized Form

Constructor Summary
AbstractCSProcessor()
           
 
Method Summary
static java.util.Set<Rule> computeGeneralizedUseableRules(RewriteSystem system, java.util.Set<java.lang.String> definedSymbols)
          Same as computeUsableRules, except that the depends relation is generalised.
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.
static java.util.Set<java.lang.String> getForbiddenFunctions(java.util.Collection<Rule> rules)
           
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterDescription()
          Default implementation for this method.
static boolean isStronglyConservative(Rule r)
           
 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

AbstractCSProcessor

public AbstractCSProcessor()
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.

computeGeneralizedUseableRules

public static java.util.Set<Rule> computeGeneralizedUseableRules(RewriteSystem system,
                                                                 java.util.Set<java.lang.String> definedSymbols)
Same as computeUsableRules, except that the depends relation is generalised. A function f depends on a function h if f = h or g depends on h and there is function l -> r such that root(l) = f and g occurs in r or non-replacing in l.

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.

getForbiddenFunctions

public static java.util.Set<java.lang.String> getForbiddenFunctions(java.util.Collection<Rule> rules)

isStronglyConservative

public static boolean isStronglyConservative(Rule r)

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.