![JAR search and dependency download from the Maven repository](/logo.png)
com.sri.ai.grinder.helper.UniquelyNamedConstantAreAllSymbolsNotIn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aic-expresso Show documentation
Show all versions of aic-expresso Show documentation
SRI International's AIC Symbolic Manipulation and Evaluation Library (for Java 1.8+)
The newest version!
package com.sri.ai.grinder.helper;
import java.io.Serializable;
import java.util.Set;
import com.google.common.base.Predicate;
import com.sri.ai.expresso.api.Expression;
import com.sri.ai.grinder.api.Registry;
/**
* A predicate indicating that uniquely named constants are all symbols not in a given collection.
*
* This predicate is useful for providing a predicate to {@link Registry#setIsUniquelyNamedConstantPredicate(Predicate)}
* for registries and contexts if we want to select a specific set of symbols as variables.
*
* @author braz
*
*/
public class UniquelyNamedConstantAreAllSymbolsNotIn implements Predicate, Serializable {
private static final long serialVersionUID = 1L;
private Set notUniquelyNamedConstants;
public UniquelyNamedConstantAreAllSymbolsNotIn(Set notUniquelyNamedConstants) {
this.notUniquelyNamedConstants = notUniquelyNamedConstants;
}
@Override
public boolean apply(Expression e) {
boolean result = e.getSyntacticFormType().equals("Symbol") && !notUniquelyNamedConstants.contains(e);
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy