org.ggp.base.util.gdl.transforms.ConstantChecker 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.
The newest version!
package org.ggp.base.util.gdl.transforms;
import java.util.Set;
import org.ggp.base.util.gdl.grammar.GdlSentence;
import org.ggp.base.util.gdl.model.SentenceForm;
import org.ggp.base.util.gdl.model.SentenceFormModel;
/**
* A ConstantChecker provides information about which sentences are true
* for the constant sentence forms in a game. These can be computed once
* at the beginning of a match, to avoid redundant computations.
*
* The preferred way to create a ConstantChecker is with
* {@link ConstantCheckerFactory#createWithForwardChaining(org.ggp.base.util.gdl.model.SentenceDomainModel)}.
*/
public interface ConstantChecker {
/**
* Returns true iff the sentence is of a constant form included in
* this ConstantChecker.
*/
boolean hasConstantForm(GdlSentence sentence);
/**
* Returns true iff the given sentence form is constant and is included
* in this ConstantChecker.
*/
boolean isConstantForm(SentenceForm form);
/**
* Returns the set of all true sentences of the given constant
* sentence form.
*/
Set getTrueSentences(SentenceForm form);
/**
* Returns the set of all constant sentence forms included
* in this ConstantChecker.
*/
Set getConstantSentenceForms();
/**
* Returns true iff the given sentence is of a constant
* sentence form and is always true.
*/
boolean isTrueConstant(GdlSentence sentence);
/**
* Returns the sentence form model that the constant checker is based on.
*/
SentenceFormModel getSentenceFormModel();
}