org.ggp.base.util.gdl.grammar.GdlProposition 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.grammar;
import java.util.Collections;
import java.util.List;
public final class GdlProposition extends GdlSentence
{
private static final long serialVersionUID = 1L;
private final GdlConstant name;
GdlProposition(GdlConstant name)
{
this.name = name;
}
@Override
public int arity()
{
return 0;
}
@Override
public GdlTerm get(int index)
{
throw new RuntimeException("GdlPropositions have no body!");
}
@Override
public GdlConstant getName()
{
return name;
}
@Override
public boolean isGround()
{
return name.isGround();
}
@Override
public String toString()
{
return name.toString();
}
@Override
public GdlConstant toTerm()
{
return name;
}
@Override
public List getBody() {
return Collections.emptyList();
}
@Override
public GdlSentence withName(GdlConstant newName) {
return GdlPool.getProposition(newName);
}
}