Class VariablePrefixSubstitution
java.lang.Object
fr.lirmm.graphik.integraal.core.AbstractSubstitution
fr.lirmm.graphik.integraal.core.VariablePrefixSubstitution
- All Implemented Interfaces:
Substitution, Comparable<Substitution>
Substitution that adds a prefix to variable identifiers.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionVariablePrefixSubstitution(String prefix) Creates a substitution adding the given prefix to variables. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe aggregation of a substitution is more complex that just add an new mapping for a new variable.createImageOf(Term term) Get the image of the given term by this substitution, if there is no image specified return the term itself.getTerms()Get the domain of this substitution.Get the codomain of this substitution.booleanAdds a mapping from the specified variable into the specified image to this substitution.booleanRemove the mapping for the specified variable.Methods inherited from class AbstractSubstitution
aggregate, appendTo, apply, apply, compareTo, compose, compose, createImageOf, createImageOf, createImageOf, createImageOf, createImageOf, createImageOf, equals, equals, hashCode, put, toString
-
Constructor Details
-
VariablePrefixSubstitution
Creates a substitution adding the given prefix to variables.- Parameters:
prefix- the prefix to add
-
-
Method Details
-
getTerms
Description copied from interface:SubstitutionGet the domain of this substitution.- Returns:
- the domain of this substitution.
-
getValues
Description copied from interface:SubstitutionGet the codomain of this substitution.- Returns:
- the codomain of this substitution.
-
createImageOf
Description copied from interface:SubstitutionGet the image of the given term by this substitution, if there is no image specified return the term itself.- Parameters:
term- the term to substitute- Returns:
- the image of the specified term.
-
put
Description copied from interface:SubstitutionAdds a mapping from the specified variable into the specified image to this substitution. Returns false if there already exists an other image for this variable, true otherwise.- Parameters:
var- the variable to mapimage- the image of the variable- Returns:
- true if the mapping was accepted, false otherwise
-
remove
Description copied from interface:SubstitutionRemove the mapping for the specified variable.- Parameters:
var- the variable whose mapping must be removed- Returns:
- true if there was a mapping.
-
aggregate
Description copied from interface:SubstitutionThe aggregation of a substitution is more complex that just add an new mapping for a new variable. Especially, it does not conserve the domain and codomain. It choose a representative term for each connected component by successive application of the mapping. For example, if the current substitution is {X -> Y, Z -> U} and you add a mapping {Y -> 'a', Z -> V}, the result is {Y -> 'a', X -> 'a', Z -> V, U -> V} or {Y -> 'a', X -> 'a', U -> Z, V -> Z} or {Y -> 'a', X -> 'a', Z -> U, V -> U}.- Parameters:
var- the variable to aggregateimage- the image to aggregate with the variable- Returns:
- false, if the aggregation put two constants into a same connected component.
-