ua.gradsoft.termware.util
Class AbstractRuleTransformer

java.lang.Object
  extended by ua.gradsoft.termware.util.AbstractRuleTransformer
All Implemented Interfaces:
ITermTransformer
Direct Known Subclasses:
ConditionalRuleTransformer, RuleTransformer

public abstract class AbstractRuleTransformer
extends Object
implements ITermTransformer


Constructor Summary
AbstractRuleTransformer()
           
 
Method Summary
abstract  Term getInPattern()
          get input pattern
abstract  Term getOutPattern()
          get output pattern
abstract  Term getTerm()
          return representation of this rule as term
protected static boolean isActionPattern(Term pattern)
          Helper method: check if pattern have form action(x,y).
protected static boolean isLetPattern(Term pattern)
          Helper method: check if pattern have form let(x,y).
protected static boolean isWherePattern(Term pattern)
          Helper method: check if pattern have form where(x,y).
abstract  Term transform(Term t, TermSystem system, TransformationContext ctx)
          attempt to transform term t .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ua.gradsoft.termware.ITermTransformer
getDescription, getName, getSource
 

Constructor Detail

AbstractRuleTransformer

public AbstractRuleTransformer()
Method Detail

transform

public abstract Term transform(Term t,
                               TermSystem system,
                               TransformationContext ctx)
                        throws TermWareException
Description copied from interface: ITermTransformer
attempt to transform term t .

Specified by:
transform in interface ITermTransformer
Parameters:
t - - term to transform
system - - system which give us access to ebvironment.
ctx - - context of transformation.
Returns:
- transformed term.
Throws:
TermWareException

getTerm

public abstract Term getTerm()
                      throws TermWareException
return representation of this rule as term

Throws:
TermWareException

getInPattern

public abstract Term getInPattern()
get input pattern


getOutPattern

public abstract Term getOutPattern()
get output pattern


isActionPattern

protected static boolean isActionPattern(Term pattern)
Helper method: check if pattern have form action(x,y).


isWherePattern

protected static boolean isWherePattern(Term pattern)
Helper method: check if pattern have form where(x,y).


isLetPattern

protected static boolean isLetPattern(Term pattern)
Helper method: check if pattern have form let(x,y).