dpvis.datastructures
Interface Rule

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
RuleImpl

public interface Rule
extends java.io.Serializable

Class modelling a term rewrite rule.

Author:
Felix

Method Summary
 void filter(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> filtering)
          Applies an argument filtering to the rule.
 java.util.Set<Pair<java.lang.String,java.lang.Integer>> getAllFunctionSymbolsWithArity()
          Gets the list of function symbols of the rule together with the corresponding arities.
 java.util.List<Rule> getConditions()
          Gets the conditions of the rule.
 java.util.Set<java.lang.String> getFunctions()
          Gets all function symbols that occur in the rule (Including conditions).
 Term getLhs()
          Gets the left-hand side of the rule.
 Term getRhs()
          Gets the right-hand side of the rule.
 boolean isConditional()
          Computes whether the rule is a conditional one.
 void markVariables(java.util.List<java.lang.String> vars)
          Marks the variables in the rule (see also Term.markVariables()).
 void removeContextSensitivityFlags()
          Removes all forbidden flags from the rules of this Rule.
 void renameVariables(java.lang.String var)
          Renames all variables (including those in conditions) of this rule.
 void setConditions(java.util.List<Rule> conditions)
          Sets the conditions of the rule.
 void setLhs(Term lhs)
          Sets the left-hand side of the rule.
 void setRhs(Term rhs)
          Sets the right-hand side of the rule.
 

Method Detail

markVariables

void markVariables(java.util.List<java.lang.String> vars)
Marks the variables in the rule (see also Term.markVariables()).

Parameters:
vars - The functions that shall be interpreted as variables.

renameVariables

void renameVariables(java.lang.String var)
Renames all variables (including those in conditions) of this rule. The new variable names will be $var1, ..., $varN (where $var is the String passed as parameter)

Parameters:
var - The variable prefix for the new variable names.

getLhs

Term getLhs()
Gets the left-hand side of the rule.

Returns:
The left-hand side of the rule.

setLhs

void setLhs(Term lhs)
Sets the left-hand side of the rule.

Parameters:
lhs - The new left-hand side of the rule.

getRhs

Term getRhs()
Gets the right-hand side of the rule.

Returns:
The right-hand side of the rule.

setRhs

void setRhs(Term rhs)
Sets the right-hand side of the rule.

Parameters:
rhs - The new right-hand side of the rule.

getConditions

java.util.List<Rule> getConditions()
Gets the conditions of the rule.

Returns:
The conditions of the rule.

setConditions

void setConditions(java.util.List<Rule> conditions)
Sets the conditions of the rule.

Parameters:
conditions - The new conditions of the rule.

isConditional

boolean isConditional()
Computes whether the rule is a conditional one.

Returns:
True if the rule contains conditions, False otherwise.

getFunctions

java.util.Set<java.lang.String> getFunctions()
Gets all function symbols that occur in the rule (Including conditions).

Returns:
All functions symbols contained in the rule.

filter

void filter(java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> filtering)
Applies an argument filtering to the rule. An argument filtering is specified by a mapping from functions to lists of argument positions, e.g. f -> [2, 3]. The argument positions in the list specify those arguments of the function symbol that are filtered, i.e. removed. So the above filtering applied to the term f(x, y, z) yields f(x). In order to indicate a collapsing filtering negative integers are used, e.g. f -> [-2], which yields y if applied to f(x, y, z).

Parameters:
filtering - The filtering given by a mapping from functions to lists of argument positions.

getAllFunctionSymbolsWithArity

java.util.Set<Pair<java.lang.String,java.lang.Integer>> getAllFunctionSymbolsWithArity()
Gets the list of function symbols of the rule together with the corresponding arities.

Returns:
A list of Pairs of function symbols and arities.

removeContextSensitivityFlags

void removeContextSensitivityFlags()
Removes all forbidden flags from the rules of this Rule.