org.ggp.base.util.gdl.grammar.GdlDistinct 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;
public final class GdlDistinct extends GdlLiteral
{
private static final long serialVersionUID = 1L;
private final GdlTerm arg1;
private final GdlTerm arg2;
private transient Boolean ground;
GdlDistinct(GdlTerm arg1, GdlTerm arg2)
{
this.arg1 = arg1;
this.arg2 = arg2;
ground = null;
}
public GdlTerm getArg1()
{
return arg1;
}
public GdlTerm getArg2()
{
return arg2;
}
@Override
public boolean isGround()
{
if (ground == null)
{
ground = arg1.isGround() && arg2.isGround();
}
return ground;
}
@Override
public String toString()
{
return "( distinct " + arg1 + " " + arg2 + " )";
}
}