Class Term
java.lang.Object
es.ucm.maude.bindings.Term
-
Method Summary
Modifier and TypeMethodDescriptionApply any rule with the given label.
apply
(String label, Substitution substitution) Apply any rule with the given label.
apply
(String label, Substitution substitution, int minDepth) Apply any rule with the given label.
apply
(String label, Substitution substitution, int minDepth, int maxDepth) Apply any rule with the given label.
Iterate over the arguments of this term.
arguments
(boolean normalize) Iterate over the arguments of this term.
check()
Check an SMT formula.
copy()
Get a copy of this term.void
delete()
boolean
Compare two terms for equality.
erewrite()
Rewrite a term following the semantics of theerewrite
command.
erewrite
(int bound) Rewrite a term following the semantics of theerewrite
command.
erewrite
(int bound, int gas) Rewrite a term following the semantics of theerewrite
command.
int
frewrite()
Rewrite a term following the semantics of thefrewrite
command.
int
frewrite
(int bound) Rewrite a term following the semantics of thefrewrite
command.
int
frewrite
(int bound, int gas) Rewrite a term following the semantics of thefrewrite
command.
Compute the most general variants of this term.
get_variants
(boolean irredundant) Compute the most general variants of this term.
get_variants
(boolean irredundant, TermVector irreducible) Compute the most general variants of this term.
long
Get the exponent of an iterable symbol or zero otherwise.static Condition
An empty condition to be used as a placeholder.getSort()
Get the sort of this term.Get the name of the variable if the current term is a variable or
a null value otherwise.boolean
ground()
Is this term ground?long
hash()
Get the hash value of the term.boolean
Get whether the term is a variable.boolean
Check whether the sort of this term is a subtype of the given sort.
Match this term into a given pattern.
Match this term into a given pattern.
Match this term into a given pattern.
Match this term into a given pattern.
Match this term into a given pattern.
void
Normalize this term modulo axioms.
void
normalize
(boolean full) Normalize this term modulo axioms.
prettyPrint
(PrintFlags flags) Pretty prints this term.
int
reduce()
Reduce this term.
int
rewrite()
Rewrite a term following the semantics of therewrite
command.
int
rewrite
(int bound) Rewrite a term following the semantics of therewrite
command.
search
(SearchType type, Term target) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
search
(SearchType type, Term target, Condition condition) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
search
(SearchType type, Term target, Condition condition, int depth) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
search
(SearchType type, Term target, StrategyExpression strategy) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
search
(SearchType type, Term target, StrategyExpression strategy, Condition condition) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
search
(SearchType type, Term target, StrategyExpression strategy, Condition condition, int depth) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
srewrite
(StrategyExpression expr) Rewrite a term following a strategy.
srewrite
(StrategyExpression expr, boolean depth) Rewrite a term following a strategy.
symbol()
Get the top symbol of this term.double
toFloat()
Get the floating-point number represented by the given term or
zero otherwise.int
toInt()
Get the integer number represented by the given term or
zero otherwise.toLatex()
Obtain the LaTeX representation of this term.toString()
vu_narrow
(SearchType type, Term target) Narrowing-based search of terms that unify with the given target.
vu_narrow
(SearchType type, Term target, int depth) Narrowing-based search of terms that unify with the given target.
vu_narrow
(SearchType type, Term target, int depth, NarrowingFlags flags) Narrowing-based search of terms that unify with the given target.
-
Method Details
-
delete
public void delete() -
symbol
Get the top symbol of this term. -
ground
public boolean ground()Is this term ground? -
equal
Compare two terms for equality.
- Parameters:
other
- The second term to be compared.
-
leq
Check whether the sort of this term is a subtype of the given sort.
- Parameters:
sort
- The pretended supertype.
-
getSort
Get the sort of this term. -
normalize
public void normalize(boolean full) Normalize this term modulo axioms.
- Parameters:
full
- Whether to normalize in depth.
-
normalize
public void normalize()Normalize this term modulo axioms.
-
reduce
public int reduce()Reduce this term.
- Returns:
- The total number of rewrites.
-
rewrite
public int rewrite(int bound) Rewrite a term following the semantics of therewrite
command.
- Parameters:
bound
- An upper bound on the number of rule rewrites.
- Returns:
- The total number of rewrites.
-
rewrite
public int rewrite()Rewrite a term following the semantics of therewrite
command.
- Returns:
- The total number of rewrites.
-
frewrite
public int frewrite(int bound, int gas) Rewrite a term following the semantics of thefrewrite
command.
- Parameters:
bound
- An upper bound on the number of rule rewrites.gas
- An upper bound on the number of rule rewrites per position.
- Returns:
- The total number of rewrites.
-
frewrite
public int frewrite(int bound) Rewrite a term following the semantics of thefrewrite
command.
- Parameters:
bound
- An upper bound on the number of rule rewrites.
- Returns:
- The total number of rewrites.
-
frewrite
public int frewrite()Rewrite a term following the semantics of thefrewrite
command.
- Returns:
- The total number of rewrites.
-
erewrite
Rewrite a term following the semantics of theerewrite
command.
- Parameters:
bound
- An upper bound on the number of rule rewrites.gas
- An upper bound on the number of rule rewrites by position.
- Returns:
- The result and the total number of rewrites (the original
term is not modified).
-
erewrite
Rewrite a term following the semantics of theerewrite
command.
- Parameters:
bound
- An upper bound on the number of rule rewrites.
- Returns:
- The result and the total number of rewrites (the original
term is not modified).
-
erewrite
Rewrite a term following the semantics of theerewrite
command.
- Returns:
- The result and the total number of rewrites (the original
term is not modified).
-
match
public MatchSearchState match(Term pattern, Condition condition, boolean withExtension, int minDepth, int maxDepth) Match this term into a given pattern.
- Parameters:
pattern
- Pattern term.condition
- Equational condition that solutions must satisfy.withExtension
- Whether the matching should be done with extension modulo axioms
(deprecated, usemaxDepth=0
instead).minDepth
- Minimum matching depth.maxDepth
- Maximum matching depth (-1
to match on top without extension,0
to match on top with extension,UNBOUNDED
to match anywhere, or any intermediate value).
- Returns:
- An object to iterate through matches.
-
match
public MatchSearchState match(Term pattern, Condition condition, boolean withExtension, int minDepth) Match this term into a given pattern.
- Parameters:
pattern
- Pattern term.condition
- Equational condition that solutions must satisfy.withExtension
- Whether the matching should be done with extension modulo axioms
(deprecated, usemaxDepth=0
instead).minDepth
- Minimum matching depth.
- Returns:
- An object to iterate through matches.
-
match
Match this term into a given pattern.
- Parameters:
pattern
- Pattern term.condition
- Equational condition that solutions must satisfy.withExtension
- Whether the matching should be done with extension modulo axioms
(deprecated, usemaxDepth=0
instead).
- Returns:
- An object to iterate through matches.
-
match
Match this term into a given pattern.
- Parameters:
pattern
- Pattern term.condition
- Equational condition that solutions must satisfy.
- Returns:
- An object to iterate through matches.
-
match
Match this term into a given pattern.
- Parameters:
pattern
- Pattern term.
- Returns:
- An object to iterate through matches.
-
srewrite
Rewrite a term following a strategy.
- Parameters:
expr
- A strategy expression.depth
- Whether to perform a depth-first search. By default, a fair search is used.
- Returns:
- An object to iterate through strategy solutions.
-
srewrite
Rewrite a term following a strategy.
- Parameters:
expr
- A strategy expression.
- Returns:
- An object to iterate through strategy solutions.
-
search
Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.condition
- Condition that solutions must satisfy.depth
- Depth bound.
- Returns:
- An object to iterate through matches.
-
search
Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.condition
- Condition that solutions must satisfy.
- Returns:
- An object to iterate through matches.
-
search
Search states that match into a given pattern and satisfy a given
condition by rewriting from this term.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.
- Returns:
- An object to iterate through matches.
-
search
public StrategySequenceSearch search(SearchType type, Term target, StrategyExpression strategy, Condition condition, int depth) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.strategy
- Strategy to control the search.condition
- Condition that solutions must satisfy.depth
- Depth bound.
- Returns:
- An object to iterate through matches.
-
search
public StrategySequenceSearch search(SearchType type, Term target, StrategyExpression strategy, Condition condition) Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.strategy
- Strategy to control the search.condition
- Condition that solutions must satisfy.
- Returns:
- An object to iterate through matches.
-
search
Search states that match into a given pattern and satisfy a given
condition by rewriting from this term using a strategy.
- Parameters:
type
- Type of search (number of steps).target
- Patterm term.strategy
- Strategy to control the search.
- Returns:
- An object to iterate through matches.
-
get_variants
Compute the most general variants of this term.
- Parameters:
irredundant
- Whether to obtain irredundant variants
(for theories with the finite variant property).irreducible
- Irreducible terms constraint.
- Returns:
- An object to iterate through variants.
-
get_variants
Compute the most general variants of this term.
- Parameters:
irredundant
- Whether to obtain irredundant variants
(for theories with the finite variant property).
- Returns:
- An object to iterate through variants.
-
get_variants
Compute the most general variants of this term.
- Returns:
- An object to iterate through variants.
-
vu_narrow
public NarrowingSequenceSearch vu_narrow(SearchType type, Term target, int depth, NarrowingFlags flags) Narrowing-based search of terms that unify with the given target.
- Parameters:
type
- Type of the search (number of steps).target
- The pattern that has to be reached.depth
- Depth bound (-1
for unbounded).flags
- Narrowing search flags (fold
,vfold
,path
,delay
, orfilter
flag).
- Returns:
- An object to iterate through solutions.
-
vu_narrow
Narrowing-based search of terms that unify with the given target.
- Parameters:
type
- Type of the search (number of steps).target
- The pattern that has to be reached.depth
- Depth bound (-1
for unbounded).
- Returns:
- An object to iterate through solutions.
-
vu_narrow
Narrowing-based search of terms that unify with the given target.
- Parameters:
type
- Type of the search (number of steps).target
- The pattern that has to be reached.
- Returns:
- An object to iterate through solutions.
-
apply
public RewriteSearchState apply(String label, Substitution substitution, int minDepth, int maxDepth) Apply any rule with the given label.
- Parameters:
label
- Rule label (or null for any executable rule).substitution
- Initial substitution that will be applied on the rule before matching.minDepth
- Minimum matching depth.maxDepth
- Maximum matching depth.
- Returns:
- An object to iterate through the rewritten terms.
-
apply
Apply any rule with the given label.
- Parameters:
label
- Rule label (or null for any executable rule).substitution
- Initial substitution that will be applied on the rule before matching.minDepth
- Minimum matching depth.
- Returns:
- An object to iterate through the rewritten terms.
-
apply
Apply any rule with the given label.
- Parameters:
label
- Rule label (or null for any executable rule).substitution
- Initial substitution that will be applied on the rule before matching.
- Returns:
- An object to iterate through the rewritten terms.
-
apply
Apply any rule with the given label.
- Parameters:
label
- Rule label (or null for any executable rule).
- Returns:
- An object to iterate through the rewritten terms.
-
check
-
arguments
Iterate over the arguments of this term.
- Parameters:
normalize
- Whether to normalize before iterating over its arguments.
-
arguments
Iterate over the arguments of this term.
-
toFloat
public double toFloat()Get the floating-point number represented by the given term or
zero otherwise. -
toInt
public int toInt()Get the integer number represented by the given term or
zero otherwise. -
isVariable
public boolean isVariable()Get whether the term is a variable. -
getVarName
Get the name of the variable if the current term is a variable or
a null value otherwise. -
getIterExponent
public long getIterExponent()Get the exponent of an iterable symbol or zero otherwise. -
hash
public long hash()Get the hash value of the term. -
copy
Get a copy of this term. -
getNO_CONDITION
An empty condition to be used as a placeholder. -
prettyPrint
Pretty prints this term.
- Parameters:
flags
- Flags that affect the term output.
-
toLatex
Obtain the LaTeX representation of this term. -
toString
-