org.ggp.base.util.gdl.model.SentenceForms Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alloy-ggp-base Show documentation
Show all versions of alloy-ggp-base Show documentation
A modified version of the GGP-Base library for Alloy.
package org.ggp.base.util.gdl.model;
import java.util.Collection;
import java.util.Set;
import org.ggp.base.util.gdl.grammar.GdlPool;
import com.google.common.base.Predicate;
import com.google.common.collect.Sets;
public class SentenceForms {
private SentenceForms() {}
public static final Predicate TRUE_PRED = new Predicate() {
@Override
public boolean apply(SentenceForm input) {
return input.getName() == GdlPool.TRUE;
}
};
public static final Predicate DOES_PRED = new Predicate() {
@Override
public boolean apply(SentenceForm input) {
return input.getName() == GdlPool.DOES;
}
};
public static Set getNames(Collection forms) {
Set names = Sets.newHashSet();
for (SentenceForm form : forms) {
names.add(form.getName().getValue());
}
return names;
}
}